Elixir library for PESEL number.
ExPesel.valid?/1
- you can check if PESEL number is validExPesel.valid_with?/2
- you can check if PESEL number is valid with additional check about sex or date of birthExPesel.birthdate/1
- you can obtain date of birth from PESEL numberExPesel.sex/1
- you can obtain sex from the PESEL numberExPesel.zombie?/1
- you can check is PESEL number is a zombie (more than 123 years before today)
More about PESEL number:
iex> ExPesel.valid?("44051401458")
true
iex> ExPesel.valid?("90720312611")
false
iex> ExPesel.valid_with?("44051401458", :male)
true
iex> ExPesel.valid_with?("88122302080", :male)
false
iex> ExPesel.valid_with?("44051401458", :female)
false
iex> ExPesel.valid_with?("88122302080", :female)
true
iex> ExPesel.valid_with?("44051401458", {1944, 5, 14})
true
iex> ExPesel.valid_with?("44051401458", {1944, 6, 13})
false
iex> ExPesel.birthdate("10320305853")
{2010, 12, 3}
iex> ExPesel.sex("88122302080")
:female
iex> ExPesel.zombie?("01920300359")
true
Package can be installed by adding ex_pesel
to your list of dependencies in mix.exs
:
def deps do
[
{:ex_pesel, "~> 0.2.0"}
]
end
Docs can be found at https://hexdocs.pm/ex_pesel.
Source code of ex_pesel is released under the Apache 2.0 license, see the LICENSE file.