South African ID Number Parser
==============================
The ID Numbers issued in South Africa follow a regular format that you
can use to derive some information about them. The following
information is available:
* Date of Birth
* Sex
* Citizenship
This library can also check if the ID number supplied is a valid South
African ID number.
More information on the ID number format can be found
here
and here.
Usage
-----
Download the library from NPM using the following command in a terminal:
```
npm install --save south-african-id-parser
```
### Usage In NodeJS
```
var saIdParser = require('south-african-id-parser');
var info = saIdParser.parse('9001049818080');
```
### Usage In the Browser
When used in the browser, the library will add the `saIdParser` object
to the window for you to use.
```
var info = saIdParser.parse('9001049818080');
```
### Parse Everything
The package exposes the `.parse(idNumber)` method for calling all of
the validation and parsing in one.
If validation fails, the resulting object only has the isValid property.
```
var saIdParser = require('south-african-id-parser');
var validIdNumber = '9001049818080';
var info = saIdParser.parse(validIdNumber);
//info === {
// isValid: true,
// dateOfBirth: new Date(1990, 01, 04),
// isMale: true,
// isFemale: false,
// isSouthAfricanCitizen: true
//}
var invalidIdNumber = '1234567';
info = saIdParser.parse(invalidIdNumber);
//info === {
// isValid: false
//}
```
### Only Validate
`.validate(idNumber)` only checks if the ID number is valid.
```
var saIdParser = require('south-african-id-parser');
var validIdNumber = '9001049818080';
var isValid = saIdParser.validate(validIdNumber);
//valid === true
```
### Only Parse Date of Birth
The method does not do a full validation on the ID number, but it will
return undefined if either the number supplied is not a 13 digit
number string or the date section of the ID number is invalid.
```
var saIdParser = require('south-afric …