Home > Common Problem > body text

What is the formula for calculating ID card verification code?

爱喝马黛茶的安东尼
Release: 2019-07-10 13:42:56
Original
90330 people have browsed it

The verification code is an important basis for identifying whether an ID number actually exists. So how do we use the check code to determine whether an ID number is authentic?

How does the verification code determine the authenticity of the ID number? Let’s take a look at the specific planning process.

What is the formula for calculating ID card verification code?

Step 1: Multiply the first digit of the ID number by 7; multiply the second digit of the ID number by 9; Multiply the 3rd digit of the ID number by 10; multiply the 4th digit of the ID number by 5; multiply the 5th digit of the ID number by 8; multiply the 6th digit of the ID number by 4 Multiply; multiply the 7th digit of the ID number by 2; multiply the 8th digit of the ID number by 1; multiply the 9th digit of the ID number by 6; multiply the 9th digit of the ID number by 6; Multiply the 10th digit by 3; multiply the 11th digit of the ID number by 7; multiply the 12th digit of the ID number by 9; multiply the 13th digit of the ID number by 10 ; Multiply the 14th digit of the ID number by 5; Multiply the 15th digit of the ID number by 8; Multiply the 16th digit of the ID number by 4; Multiply the 17th digit of the ID number. The digit number is multiplied by 2.

Related recommendations: "FAQ"

Step 2: Sum the results of multiplying 1 to 17 digits of the ID number in the first step and add them all up .

Step 3: Divide the result calculated in the second step by 11, so that the remainder is 0, the remainder is 1, the remainder is 2, the remainder is 3, the remainder is 4, the remainder is 5, The remainder is 6, the remainder is 7, the remainder is 8, the remainder is 9, the remainder is 10, a total of 11 possibilities.

Step 4: If the remainder is 0, the corresponding number of the last ID card is 1; if the remainder is 1, the corresponding number of the last ID card is 0; if the remainder is 2 , the corresponding number of the last ID card is X; if the remainder is 3, the number of the corresponding last ID card is 9; if the remainder is 4, the number of the corresponding last ID card is 8; If the remainder is 5, then the corresponding number of the last ID card is 7; if the remainder is 6, then the number of the corresponding last ID card is 6; if the remainder is 7, then the number of the corresponding last ID card is 7 The number is 5; if the remainder is 8, then the corresponding number of the last ID card is 4; if the remainder is 9, then the corresponding number of the last ID card is 3; if the remainder is 10, then the corresponding number of the last ID card is 3 The ID card number is 2.

For example: ID number 432831196411150810 Is this ID card a valid ID number? Please see the verification code analysis.

What is the formula for calculating ID card verification code?

The check code is 0, and the last digit in the ID number 432831196411150810 is 0, so this is a valid ID number.

The above is the detailed content of What is the formula for calculating ID card verification code?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!