ZAIDNumber ========== A simple gem for working with South African ID numbers. Details ======= South African ID numbers have a fair amount of information serialized into them, including an all important checksum number. The below information is taken from a page deep within [The Western Cape Government's website](https://www.westerncape.gov.za/general-publication/decoding-your-south-african-id-number-0). A South African ID number is a 13-digit number which is defined by the following format: `YYMMDDSSSSCAZ`. - The first 6 digits (`YYMMDD`) are based on your date of birth. **20 February 1992** is displayed as `920220`. - The next 4 digits (`SSSS`) are used to define your gender. Females are assigned numbers in the range 0000-4999 and males from 5000-9999. - The next digit (`C`) shows if you're a ZA citizen status, with 0 denoting that you were born a ZA citizen and 1 denoting that you're a permanent resident. - The last digit (`Z`) is a checksum digit – used to check that the number sequence is accurate using a set formula called the [Luhn algorithm](https://en.wikipedia.org/wiki/Luhn_algorithm). The graphic below details the different sections of an ID number, based on the fictitious sequence `9202204720082` ![ZA ID Number Infographic](za-id-number.png) Installation ------------ Add this line to your application's Gemfile: ```ruby gem 'za_id_number' ``` And then execute: ``` $ bundle ``` Or install it yourself as: ``` $ gem install za_id_number ``` Usage ----- Given a valid ZA ID Number, `7501151234085`, the following interface is available: ```ruby id_number = ZAIDNumber.new('7501151234085') # => #