Kennitala v0.0.1 Kennitala

Summary

Types

Tuple with {Year, Month, Day}

Functions

Get the birthday from kennitala

Get the type of kennitala

Check legality of kennitala

Types

date_tuple :: {pos_integer, pos_integer, pos_integer}

Tuple with {Year, Month, Day}

Functions

get_birthdate(kennitala)

Specs

get_birthdate(String.t) :: date_tuple

Get the birthday from kennitala

iex> Kennitala.get_birthdate("0102031129")
{1903, 2, 1}
type(kennitala)

Specs

type(String.t) :: :individual | :corporate

Get the type of kennitala.

iex> Kennitala.type("1111111119")
:individual
valid?(kennitala)

Specs

valid?(String.t) :: boolean

Check legality of kennitala

iex> Kennitala.valid?("1111111119")
true