China's second generation ID card verification js Code, China's second generation js Code

Source: Internet
Author: User

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}


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.