Taiwan's resident identity identification document coding rules

zhaozj2021-02-16  45

Disclaimer: All reprints need to indicate the original link of the URL. These links should come from www.9cbs.com.

What is introduced here is that I gathered on the NET. May not be allowed. It may also be invalid. Probably year is around 1995. Is there a new regulation, don't look, I haven't found it yet. The purpose of writing this document is to introduce our programmers to the coding rules in order to require documents to be used in Taiwan, expand the application space of the program. Technical people talk about technology, music is not tired. Say: 1, briefly: The document code consists of 10 digits. The first is English letters, representing regional division. There is a corresponding number code. The last bit is a check-in to verify the effectiveness of the document code.

2, first letter, code, area corresponding to: / ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ / ╓ ----------------------------------------- ╖║ Letter, code, area Correspondence table ==== ┬ ======= ┬ ======= ┬ === ╢║ code | Traditional | Simplified | Word ==== ====== == ======== === ╢║ 10 | Taipei | Taipei | a ║╟ ==== ======== ======== === ╢║ 11 | Taizhong City | Taichung City | B ║╟ ==== ======== ======== === ╢║ 12 | Keelung City | Keelung City | C ║╟ ===== =============================================================================================================================================================================== ======== ======== === ╢║ 14 | Kaohsiung City | Kaohsiung City | E ║╟ ==== ======== == ====== === ╢║ 15 | Taipei County | Taipei County | F ==== ======== ======= === ╢ ║ 16 | Yilan County | Yilan County | g ║╟ ==== ======== ======== === ╢║ 17 | Taoyuan County | Taoyuan County | H ║ ╟ ==== ======== =======

= === ╢║ 18 | Hsinchu County | Hsinchu County | J ║╟ ==== ======== ======== === ╢║ 19 | Miaoli County | Miaoli County | K ===== ========= ========================================================================================================================================================================================================================================= ======== ======== === ╢║ 21 | Nantou County | Nantou County | M ║╟ ==== ======== = ======= === ╢║ 22 | Changhua County | Changhua County | n ║╟ ==== ======== ======== === ╢║ 23 | Yunlin County | Yunlin County | P ==== ======== ======== === ╢║ 24 | Chiayi County | Chiayi County | Q =============================================================================================================================================== ====== ======== === ╢║ 26 | Kaohsipo County | Kaohsiung County | s ║╟ ==== ======== ==== ==== === ╢║ 27 | Pingtung County | Pingtung County | T ║╟ ==== ======== ======= ===

╢║ 28 | Hualien County | Hualien County | U ║ = ==== ======== ======== === ╢║ 29 | Taitung County | Taitung County | V ║╟ ==== ======== ======== === ╢║ 30 | Wuhu County | Wuhu County | X ║╟ ==== == ====== ======== === ╢║ 31 | Yangming Mountain | Yangming Mountain | Y ║╟ ==== ======== ==== ==== === ╢║ 32 | | | w ║╟ ==== ======== ======== === ╢║ 33 | | | Z ║╟ ==== ======== ======== === ╢║ 34 | Chiayi City | Chiayi City | I ║╟ ==== ==== ==== ======== === ╢║ 35 | Hsinchu City | Hsinchu City | o ║╙ ==== ┴ ======= ┴ ======= ┴ === ╜ (Table 1) 3, Number Calculation: 3.1 Description First Step: Convert letters into numbers as a table. Step 2: The newly composed of numbered correspondence is multiplied by the corresponding position of 1987654321. Step 3: Plus all the product taken by the corresponding bit bypass. Step 4: The accumulation and mod 10 can be used. Step 5: 10 - The modulus gets the check code. Step 6: Compare the calibration code with the place of the encoding.

OK.3.2 Example order number: a 1 0 0 9 8 7 6 3 8 Character of the table: a ---> 10. Composition new number 1 0 1 0 0 9 8 7 6 3 8 corresponds to the position: 1 0 1 0 0 9 8 7 6 3 8 new number * 1 9 8 7 6 5 4 3 2 1 constant -------------------------- --------------------------- (1) (0) (8) (0) (0) (45) (32) (21) (12) (3) Adding the number of new products plus x = 1 0 8 0 0 45 32 21 12 3X = 122 calculation modulus m = x% 10 = 122% 10 = 2 Calculate the check code check_code = 10 - m = 10 - 2 = 8 Number correct. 4, code, alphabet algorithm: let alphabet: abcdefghjklmnpqrstuvxywzio sequence number: 12345678 .... The corresponding code = alphabet number 9. For example, C, 3 9 = 12, check the table is correct. 5, C Code: BOOL_STDCALLTAIWANUSERID (Char * S) {char * list = "AbcdefghjklmnpqrStuvxywzio"; char * p; int x; // Inlet check if (Strlen (s)! = 10) {Return False;} P = strChr List, TouPper (* s));

IF (p == null) {Return False;}

x = (int); x = x% 10 * 9 x / 10;

P = S 1;

IF (* p! = '1' && * p! = '2') {Return False;}

For (int i = 1; i <9; i ) {if (isdigit (* p)) {x = (* p - '0') * (9-i);} else {return false;}}

X = 9 - x% 10;

Return (x == (* p-'0 '));

}

Reference: Zhangchao planting, "Identity Card Font Identification Code Identification Design", Eternal Journal, Dec.1993, P156

转载请注明原文地址:https://www.9cbs.com/read-28295.html

New Post(0)