Because the response speed is extremely fast, it is certainly not the correctness of online verification. That is to say, the second-generation ID card has other self-verification rules besides the rules that everyone knows about birthday and gender. So I opened the page source code and found that this section of js was not compressed, so the rules are quite understandable.
I am here to give you some tips. I don't know if it's Mars.
The following code is from here, and copyright belongs to Shanda. Of course, you can also find more detailed introductions and Algorithms in Wikipedia.
Copy codeThe Code is as follows:
IW = new Array );
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 = 10) sJYM = "2 ";
Var cCheck = v_card.charAt (17). toLowerCase ();
If (cCheck! = SJYM ){
Return false; // a false number is not displayed.
}