How to verify the ID card number!

Source: Internet
Author: User
1. Number structure: 1 Address Code (the first six digits of the ID card) indicates the Administrative Code of the county (city, town, district) where the resident account of the encoding object is located. The 2native Date Code (the seventh to 14th digits of the ID card) indicates the year, month, and day of the birth of the encoding object. The year is represented by four digits, and there is no separator between the year, month, and day. For example, 19810511 is used for representation. 3. The sequence number of the person born in the same year, month, or day within the range of the region indicated by the address code (15th to 17 digits of the ID card. Among them, the 17th-digit odd number is given to men, and the even number is given to women. 4. The verification code (the last digit of the ID card) is the verification code calculated based on the first 17-digit code according to the ISO 7064: 1983.mod 11-2 verification code. The checksum of the ending number is calculated by the number preparation unit according to the unified formula. If a person's ending number is 0-9, NO x will appear, but if the ending number is 10, then we should replace it with X, because if we use 10 as the ending number, this person's ID card will become 19 digits, and the 19 digits number will violate the national standard, in addition, China's computer application system does not recognize the 19-digit ID card number. X is the 10 of the Roman numerals. Replacing 10 with X can ensure that the ID card of a citizen complies with national standards. 2. Verification Code: Calculate the 18th-bit ID card (Verification Code). 1. Multiply the 17-digit ID card number in front by different coefficients. The coefficients from the first digit to the second digit are: 7-9-10-5-8-4-2-1-6-3-7-9-10-5-8-4-2. 2. Add the result of multiplying the 17-digit number and the coefficient. 3. How much is the remainder by adding and dividing by 11? 4. The remainder may only contain the 11 numbers 0-1-2-3-4-5-6-7-8-9-10. The numbers corresponding to the last ID card respectively are 1-0-x-9-8-7-6-5-4-3-2. 5. If the remainder is 2, the last digit of the ID card is the Roman numerals X. If the remainder is 10, 2 is displayed on the 18th digits of the ID card. For example, the ID number of a male is 34052419800101001x. Let's see if this ID card is a valid ID card. First, we get the product of the first 17 bits and the product is 189. Then we divide 189 by 11 and the result is 17 + 2/11, that is, the remaining number is 2. Finally, the corresponding rule shows that remainder 2 corresponds to the Roman numerals X. Therefore, it can be determined that this is a qualified ID card number. Protected void button1_click (Object sender, eventargs e) {// string idcard = "3 7 1 1 2 2 1 9 9 4 1 1 0 3 0 6 5 0 "; // string xishu = "7 9 10 5 8 4 2 1 6 3 7 9 10 5 8 4 2"; // The coefficient is fixed !! Int Yu = (21 + 63 + 10 + 5 + 16 + 8 + 2 + 9 + 54 + 12 + 7 + 9 + 0 + 15 + 0 + 24 + 10) % 11; response. write (Yu ); // 0-1-2-3-4-5-6-7-8-9-10 check the number corresponding to the remainder. Here, my remainder is 1, so my last digit is 0, // 1-0-x-9-8-6-5-4-3-2.}

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.