Verification of the ID number

Source: Internet
Author: User

China's current use of Citizen ID card number There are two kinds of respect two national standards, GB 11643-1989〗 and GB 11643-1999〗.

GB 11643-1989〗 is a 15-digit identification number: The order is numbered from left to right: six-digit address code, six-digit birth date code, and three-digit sequential code, where the birth date code does not contain the century number.

GB 11643-1999〗 is a 18-digit identification number: The citizenship number is a feature combination code, consisting of a 17-bit digital body code and a one digit check code. The sorting order is from left to right: six-digit address code, eight-digit birth date code, three-digit sequential code, and one-digit check code.

The address code represents the code of the county (city, Flag, district) of the resident household account.

The date code represents the year, month, and day of the birth of the encoded object, where the year is represented by a four-digit number, with no separator between the year, month, and day.

Sequential codes denote the sequence numbers of persons born in the same year, month, and day, within the range of the area identified by the same address code.
The odd number of sequential codes is given to males, even to females.

Verification code is based on the previous 17-digit code, according to the ISO 7064:1983.mod 11-2 Check code calculated by the test code.

Why in addition to 11, it is the function that calculates the check code. Take a look at the function below:

The formula is as follows:
∑ (A[i]*w[i]) mod one (i = 2, 3, ..., 18) (1)
"*" means multiplication sign
I--------indicates the serial number of each digit of the ID number, from right to left, the leftmost side is 18, the rightmost is 1.
A[i]-----Represents the number of the ID number on the first digit
W[i]-----Represents the weighted value on the I-bit w[i] = 2^ (i-1) MoD 11
Formula (1) to make the result R
According to the following table to find R corresponding check code is required for identification number of the check code C.
R 0 1 2 3 4 5 6 7 8 9 10
C 1 0 X 9 8 7 6 5 4 3 2
Thus, X is 10, and 10 of the Roman numerals are X, so the new standard ID number may contain a non-numeric letter x.

~ (key to see) ~ This function expansion is:

A[1]*w[1]+a[2]*w[2]+......+a[18]*w[18]=?
? Mod11= "? For the 11 modulo "
such as: 22mod11=2 23mod22 is also 2 33mod11=3
It is out of the number of the back, only the operator does not take the remainder

So from the function and its expansion of the view to the 11 modulo, the one to divide 11




The 18th digit is calculated as: 1. Multiply the previous ID number 17 digits by the different coefficients respectively. The coefficients from first to 17th are: 7 9 10 5 8 4 2 1 6 3 7 9 10 5 8 4 2 2 Adds the result of multiplying these 17 digits and coefficients. 3. Add and divide by 11 to see what the remainder is? 4 can only have 0 1 2 3 4 5 6 7 8 9 10 This 11 number. The number of the last identity card corresponding to the respective is 1 0 X 9 8 7 6 5 4 3 2. 5. By knowing that if the remainder is 2, the Ⅹ of the Roman numerals will appear on the 18th digit of the identity card. If the remainder is 10, the last number of the ID card is 2. For example: A man's identity card number is 34052419800101001X. We need to see if this ID card is legal. First: We conclude that the sum of the first 17 bits is 189 and then: The result of dividing 189 by 11 is 17 + 2/11, which means that the remainder is 2. Finally: the corresponding rule can be used to know that the remainder of 2 corresponds to the number is X. So, this is a qualified ID number.

Verification of the ID number

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.