ZaIdNumber.Validator (za_id_number v0.1.2)

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

Link to this section Summary

Functions

Validates and returns id number information.

Link to this section Types

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

Link to this section 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.