Calculation method of the last one of the 18 identity card number

xiaoxiao2021-03-06  40

Introduction to the completion of the 18-digit card number The last check code citizenship number is the feature group code, consists of the seventeenth digital body code and a check code. Arrange the order from left to right as: six digit address code, eight digit born date code, three digital sequence code and one digital check code. Calibration method: (1) Seventeen digital body code weighted summation formula S = SUM (AI * Wi), i = 0, ..., 16, first on the top 17 digits and AI: I location ID number Number Wi: Represents Weighted Factor Wi: 7 9 10 5 8 4 2 1 6 3 7 9 10 5 8 4 2 (2) Calculation Mode Y = MOD (S, 11) ) (3) Get the corresponding check code y: 0 1 2 3 4 5 6 7 8 9 10 Check code: 1 0 x 9 8 7 6 5 4 3 2 Next is the C program code: // char szsrc1 [] = "11010519491231002x"; // Doverify (szsrc1); // char SZSRC2 [] = "440524188001010014"; // Doverify (szsrc2); char Doverify (const char * pszsrc) {int I = 0; int tent [[] = {7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2}; static char szvercode [] = "10x98765432"; int i; For (i = 0; i <17; i ) {is = (int) (PSZSRC [I] - '0') * i [i];} int} INT IY = IS% 11; // Printf ("% D %% 11 = IY =% D / N ", IS, IY); // Printf ("% C / N ", Szvercode [iY]); Return Szvercode [iY];

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

New Post(0)