GetoXs / PeselTools

Tools and helpers for PESEL (Polish identification number). Simple and fast valid and parse (sex, birthday) from string values.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PeselTools

NuGet NuGet

Tools and helpers for PESEL (Polish identification number). Simple and fast valid and parse (sex, birthday) from string values.

Fully cooperate with checksum checking and 2000+ birthdays

Install

with nuget

Install-Package PeselTools

with .NET CLI

dotnet add package PeselTools

How to use

Parse

  //Parse
  string value = "70092746571";
  var pesel = Pesel.Parse(value);
  
  //or TryParse
  var isValid = Pesel.TryParse(value, out var result);

  //birthday
  var bd = pesel.BirthDate;

  //sex
  var sex = pesel.Sex;

  Console.WriteLine($"Pesel {pesel}. Birthday: {bd}, sex: {sex}.");

Validation only

  string value = "70092746571";
  var isValid = Pesel.IsValid(value);

About

Tools and helpers for PESEL (Polish identification number). Simple and fast valid and parse (sex, birthday) from string values.


Languages

Language:C# 100.0%