ExPesel

Elixir library for PESEL number.

More about PESEL number:

Usage

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

Installation

Package can be installed by adding ex_pesel to your list of dependencies in mix.exs:

def deps do
[
{:ex_pesel, "~> 0.1.0"}
]
end

Documentation

Docs can be found at https://hexdocs.pm/ex_pesel.

License

Source code of ex_pesel is released under the Apache 2.0 license, see the LICENSE file.