Because the response speed is extremely fast, it is certainly not the online checksum correctness, that is to say, the second-generation ID card except for the number of birthdays and genders that everyone knows, there are other rules for self-regulation. So open the page source view, found that this section of JS has not been compressed, so the rules are very understood.
Here to everyone under the popular science, do not know is not Mars, hehe.
The following code comes from here and the copyright is grand. Of course, you can also find a more detailed introduction and algorithm in Wikipedia.
Copy Code code as follows:
IW = new Array (7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2,1);
Isum = 0;
for (i=0;i<17;i++) {
IC = V_card.charat (i);
Ival = parseint (IC);
Isum + + ival * Iw[i];
}
Ijym = isum% 11;
var sjym = ';
if (ijym = 0) Sjym = "1";
Else if (ijym = 1) Sjym = "0";
Else if (Ijym = 2) Sjym = "X";
Else if (Ijym = 3) Sjym = "9";
Else if (Ijym = 4) Sjym = "8";
Else if (Ijym = 5) Sjym = "7";
Else if (Ijym = 6) Sjym = "6";
Else if (Ijym = 7) Sjym = "5";
Else if (Ijym = 8) Sjym = "4";
Else if (Ijym = 9) Sjym = "3";
Else if (Ijym = ten) Sjym = "2";
var ccheck = V_card.charat. toLowerCase ();
if (Ccheck!= sjym) {
return false;//No, that's fake number
}