ID number verifier
The ID number verifier is a verification tool that can be used to verify whether the ID number is valid.
Features
1. Support batch input verification
2. Support reading verification from database
3. Support SQL SERVER
4. Support ORACLE
The structure of the ID number
According to the regulations on citizen identity numbers in the National Standard of the People's Republic of China GB 11643-1999, the citizen identity number consists of a seventeen-digit body code and a one-digit check code. The sorting order from left to right is:
1. Six-digit address code: represents province (autonomous region, municipality directly under the Central Government, special administrative region), city (summary code of prefecture-level cities, autonomous prefectures, leagues and municipalities and counties under the jurisdiction of national municipalities), county (municipal districts, county-level cities, flag).
* The first and second digits indicate province (autonomous region, municipality directly under the Central Government, special administrative region).
* The third and fourth digits represent the city (aggregated code for prefecture-level cities, autonomous prefectures, leagues and national municipalities, districts and counties). Among them, 01-20 and 51-70 represent provinces and municipalities; 21-50 represent regions (autonomous prefectures and leagues).
* The fifth and sixth digits represent counties (municipal districts, county-level cities, flags). 01-18 indicates county-level cities under the jurisdiction of municipal districts or regions (autonomous prefectures, leagues); 21-80 indicates counties (banners); 81-99 indicates county-level cities directly under the jurisdiction of provinces.
2. Eight-digit birth date code: indicates the year, month and day of birth (the left side of the odd-digit month and day is padded with 0). The year is represented by four digits, with no separators between the year, month, and day.
3. Three-digit sequence code: indicates the sequence number assigned to persons born in the same region, year, month, and day.
4. One-digit check code: As the check code for the tail number, it is calculated by the number compilation unit according to a unified formula. If the number 10 appears in the check code, use X instead.
Check code algorithm
1. Multiply the first 17 digits of the ID number by different coefficients. The coefficients from the first to the seventeenth position are: 7-9-10-5-8-4-2-1-6-3-7-9-10-5-8-4-2.
2. Add the results of multiplying the 17-digit numbers and the coefficients.
3. Divide the added sum by 11 and take the remainder.
4. The remainder can only be 11 numbers: 0-1-2-3-4-5-6-7-8-9-10. The corresponding last ID number is 1-0-X-9-8-7-6-5-4-3-2.
For example:
If the remainder is 3, the check code at the 18th digit is 9. If the remainder is 2, then the corresponding check code is X, and X is actually the Roman numeral 10.
Next step
The editor of Downcodes will continue to explore more knowledge about ID number validators and share them with you!