Skip to content

Latest commit

 

History

History
34 lines (25 loc) · 543 Bytes

README.md

File metadata and controls

34 lines (25 loc) · 543 Bytes

ZA Id Number

Validates South African ID Numbers.

Installation

def deps do
  [
    {:za_id_number, "~> 1.0.0"}
  ]
end

Usage

iex> ZaIdNumber.validate("12345")
{:error, "Invalid ID Number format"}

iex> ZaIdNumber.validate("[valid id number]")
{:ok, %{
   gender: :male | :female,
   age: pos_integer(),
   date_of_birth: Date.t(),
   citizen_status: :born_citizen | :permanent_resident
  }
}

Development

To run the tests, ensure to update the csv file ./test/id_numbers.csv with your test cases.