"Why does my ID number have a cross at the end? I see everyone else's has numbers. Is it because I'm so awesome? X-Man!" The "divine beast" at home suddenly pointed at the X on his ID number in the household registration book and asked a series of questions. Seeing how happy the child was, I really couldn't bear to tell him how many small troubles this X would bring. If you search the Internet, you will find many "X people" complaining about default passwords. For most people whose ID numbers end in numbers, it is common to use the last six digits as the initial password for various accounts and documents. But for the "chosen ones" whose ID numbers end in X, it is not that simple. Not only do different systems require X to be written in different upper and lower cases, some even set the initial password for "Person of X" to remove the X and then move forward one position... Who can enter it correctly in one go? If it is so troublesome, why does the ID number have to have the letter X? How are these people chosen to become "X people"? Counting with your fingers, you are X The birth of the last X actually depends entirely on the "support" of the first 17 digits. The ID card in common use now is the second generation of resident ID cards, and the 18-digit ID number has become a number engraved in everyone's mind. The X at the end of the ID number also represents a number, indicating the number "10". The front of the second-generation resident ID card has the national emblem, the name of the certificate, the issuing authority and the validity period of the certificate. The back has a photo and personal identity information. The last line includes the citizen ID number, which is commonly known as the "ID number." 丨Resident ID card format, Ministry of Public Security industry standard "General Technical Requirements for Resident ID Cards" GA/T 448-2021 The Citizen ID Number consists of 18 digits: The 6-digit address code is determined according to the Administrative Division Code of the People's Republic of China (GB/T 2260), which is the administrative division code of the county where the household registration is located. Since the administrative division code has been revised many times in history, the first six digits may not be the same even if people were born in the same area. 8-digit date of birth code, 4-digit year + 2-digit month + 2-digit day. 3-digit sequential code, odd numbers for males and even numbers for females. Finally, add a check digit. Citizen ID Number Structure丨National Standard "Citizen ID Number" GB11643-1999 The ID number is full of "randomness" - we cannot plan when or where we will be born. However, the last check digit has become "certainty in uncertainty". As long as the first 17 digits are determined, the last digit is also determined. It is a number obtained by substituting the first 17 digits into the calculation through a set of algorithms. The purpose of such laborious calculation is to make it easier to check for errors later. Various errors may occur when entering the ID number. In addition to obvious errors such as missing characters and extra characters, it is not easy to find the wrong number. The check code can "reverse" whether the ID number is entered correctly, and can even identify errors such as the reverse or misplaced two adjacent digits. Of course, the checksum is only to prevent random errors. It cannot detect intentional forgery errors, nor can it be used to automatically correct discovered errors. How did you calculate the number 10? If there is an X at the end, it is because of this verification algorithm. This algorithm uses the method of modulo 11, and the calculation result range is 0 to 10. However, the ID card has only 18 digits, and the ending is 10, which means there is one more digit. Therefore, the "important task" of 10 is given to X to represent. Tips: If you are confused by formulas, you can skip this part... The algorithm for the last digit of the ID card uses the MOD 11-2 check code system given in ISO 7064 "Data Processing - Check Code Systems". Here, MOD 11-2 means that the modulus is 11 and the base is 2. That is, in the check formula (see below), the total number needs to be divided by 11 (modulus) and the remainder is taken, and the weighting factor at each position is calculated by a geometric series with 2 (base) as the base. The check digit in the ID number is located at the rightmost, so its position number i=1, and the corresponding weighting factor W1 is also equal to 1. According to the formula, we need to multiply the digits in other positions in the ID number by the corresponding factors, add them up to get the total, and then divide the total by 11 and take the remainder. If this remainder is added to the check digit (multiplied by 1 or itself), and the remainder when divided by 11 is 1, it means that this number can meet the verification of the formula. In order to facilitate calculation, the national standard directly provides a corresponding table of the conversion relationship between the check code a1 and the remainder. Because the modulus is 11, the final result has 10 possibilities from 0 to 10. In order to ensure that the check code only occupies 1 character position, when the calculated a1 is equal to 10, it is represented by the Roman numeral X on the ID card. (Yeah, X finally showed up!) To put it simply, the appearance of X is because the modulus is 11. The verification algorithm is designed to cover as many common ID card number entry errors as possible. For the case of modulus 11, Appendix A of the ISO 7064 standard gives the effectiveness of the algorithm: it can identify all single substitution, single transposition and displacement errors, and the recognition rate of double substitution errors is also 90%. Is it okay not to have X? Relatively speaking, although modulo 10 can avoid the appearance of X, its recognition rate for the error of swapping two adjacent bits is low, which also means that when there are 2 or more errors, the recognition rate of 90% cannot be guaranteed. Another way to avoid the appearance of X is to not use a number string that will generate a checksum value of 10. However, because the first 14 digits of the ID number are basically fixed, except for the checksum, only the last three digits of the sequence code can be adjusted. In this way, the number of numbers that can be accommodated in the same area on the same day is much smaller. The Norwegian ID number has 11 digits. The first six digits are the date of birth in the order of DDMMYY (day-month-year), followed by a 3-digit random number and a 2-digit check digit. The first check digit is responsible for checking digits 1 to 9, and the second check digit is responsible for checking digits 1 to 10. They are counted twice, and the weights are different. Norway's checksum algorithm is also modulo 11, and in order to avoid the appearance of X, they discarded all number strings that would produce a checksum value of 10. This caused them to lose about 17% of their available capacity. Iceland's ID number is a bit like Norway's, and the checksum algorithm is also modulo 11. In order to avoid the appearance of X, they also abandoned all number strings that would produce a checksum value of 10. With only 2 random digits, only about 80 people are born at the same time in Iceland every day... Considering that Iceland's total population is only about 370,000, based on the 1.5% population growth rate in 2020, 80 is still sufficient. Verification code everywhere In addition to ID cards, there are many codes that require a string of numbers to represent that contain verification codes. Some checksums contain more than just X. For example, the current unified social credit code for legal persons and other organizations in my country consists of 18 Arabic numerals or uppercase English letters (not using I, O, Z, S, V). The 17th digit is the checksum for the 9th to 16th digits (modulo 11). The 18th digit is the checksum for the first 17 digits. Although the ISO 7064 checksum system is also used, the MOD 31-3 algorithm system is selected to be compatible with possible English letters. The calculated checksum value may range from 0 to 30, with uppercase English letters A to Y (excluding I, O, Z, S, V) representing numbers between 10 and 30. The QR codes that we often use in our daily lives actually have a verification function. When the QR code generation program writes information into the two-dimensional pattern, it uses an error correction code generation algorithm called BCH coding to write redundant information into the pattern. Through a special decoding algorithm, the program can not only verify whether there are any errors in the data, but also know where the errors are, so that the program can automatically correct and restore the data. The QR code with the highest fault tolerance level can correctly restore the complete information even when up to 30% of the data cannot be read. In life, there are many numbers and letters that are secretly verifying whether certain labels are correct or not. Although sometimes "X people" may encounter some minor troubles, the verification code still helps people avoid many subtle errors. Different systems use different data types when designing the code, which results in some being able to read X but others not. This results in different rules to restrict the last digit of input. In short, I hope that all systems can unify the input rules for the last digit as soon as possible. “Man X” is really tired. References [1] GA/T 448-2021 General Technical Requirements for Resident Identity Cards. https://hbba.sacinfo.org.cn/attachment/onlineRead/a90a5a366e77dd80a07c5ef29df56bcc8fe1d92996727162f185eeff93ceaea7 [2] GB 11643-1999 Citizen Identity Number. https://openstd.samr.gov.cn/bzgk/gb/newGbInfo?hcno=080D6FBF2BB468F9007657F26D60013E Author: Ou Sha Editor: Owl, Window Knocking Rain Guokr (ID: Guokr42) If you need to reprint, please contact [email protected] Welcome to forward to your circle of friends Source : Guokr |
>>: Why are primates called “primates”?
Push is a message push, which serves to remind or...
Everyone should understand that mobile phones can...
In June this year, an American auction house is a...
"My eyes are dry, so I can just put in some ...
When those born after 1995 start to become parent...
[September 9 news] Recently, the famous technolog...
In the past few months, Huajiao, Inke, Yizhibo an...
We will teach you how to write a perfect product ...
The annual 3.15 Gala of China Central Radio and T...
Some time ago, shared bicycles were regulated in ...
In the past few years, there are some things that...
After manually restoring the Sanxingdui golden ma...
The simplest logic for marketing is to ask yourse...
Produced by: Science Popularization China Author:...
Event planning is an important part of marketing ...