The format of a normal South-African ID number is as follows
{YYMMDD}{G}{SSS}{C}{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 : Usually 8, or 9 (can be other values)
Z : Control digit.
The following logic explains how the control digit works:
For this explanation I am going to use ID number 860506 5 397 08 3
a) Add all the digits of the ID number in the odd positions (except for the last number, which is the control digit):
8+0+0+5+9+0 = 22
b) Take all the even digits as one number and multiply that by 2:
656378 * 2 = 1312756
c) Add the digits of this number together (in b)
1+3+1+2+7+5+6 = 25
d) Add the answer of C to the answer of A
22+25 = 47
e) Subtract the second character from D from 10, this number should now equal the control character
10-7 = 3 = control character (3)
and thus, if you ever have to validate an ID number this would be the best way to do it ...
Following are more links:
What is a South African ID number made up of?
{Resloved} ID number gender checking