Skip to content

Latest commit

 

History

History
48 lines (33 loc) · 976 Bytes

README.md

File metadata and controls

48 lines (33 loc) · 976 Bytes

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);