ZaIdNumber.Validator (za_id_number v1.1.0)

SA ID Number format can be define as follow

YYMMDDSSSSCAZ

YY - year of birth MM - month of birth DD - day of birth SSSS - gender classification C - Citizen status A - Unused Z - Checksum

Summary

Functions

Validates and returns id number information.

Types

@type result() :: %{
  gender: :female | :male,
  age: pos_integer(),
  date_of_birth: Date.t(),
  citizen_status: :born_citizen | :permanent_resident
}

Functions

Link to this function

validate(value, opts \\ [])

@spec validate(id_number :: binary(), opts :: keyword()) ::
  {:ok, result()} | {:error, binary()}

Validates and returns id number information.