China's second generation ID card verification js Code, China's second generation js Code
The following part of the code is taken from a large webpage. I will not give the url any more. below is the corresponding js Code:
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"; el Se 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 returned if you cannot connect to the client}