13 digit South African Identity Numbers have the following format
{YYMMDD}{G}{SSS}{A}{Z}
YYMMDD Date of birth
G Gender: 0-4 = Female, 5-9 = Male
SSS Sequence No. for DOB/G combination.
C Citizenship: 0 = SA, 1 = other
A generally, but not strictly = 8, 9
Z CheckSum Digit
Calculation of Checksum Digit = Z
A = sum of digits in odd position (excluding last checksum digit)
B = sum of all the digits of the product of 2 and the number formed from the original be removing all the odd digits
C = A + B
Z = 10 - (second digit of C)