Kennitala Build StatusCoverage Status

Elixir library for validating and handling the Icelandic Kennitala national identity number.

Kennitala are 10 digit numbers.

It's common to represent the Kennitala with a hyphen after the first 6 digits (ie. 111111-1119) and it is supported by this library.

Wikipedia Description

The kennitala (plural: kennitölur; abbreviated kt.) (English: Identity Number) is a unique national identification number used by the Icelandic government to identify individuals and organisations in Iceland, administered by the Registers Iceland. Kennitölur are issued to Icelandic citizens at birth, and to foreign nationals resident in Iceland upon registration. They are also issued to corporations and institutions.

...

The system is similar to that employed by some other European countries, but Iceland makes unusually extensive and public use of its kennitölur, with businesses and educational institutions eschewing internal identification numbers in favour of the national system, and its use being mandated in banking transactions. Furthermore, online banking services in Iceland offer a lookup service to check names against numbers. Because of their public nature, kennitölur are not used for authentication. The completeness of the National Register has eliminated the need for the country to conduct a regular census: population statistics can be obtained by simply querying the database.

Installation

Using Hex, the package can be installed as:

  1. Add kennitala to your list of dependencies in mix.exs:

    def deps do

     [{:kennitala, "~> 1.0.0"}]

    end

Usage

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

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

iex> Kennitala.type("111111-1119")
:individual