The legitimacy of JS's verification organization

Source: Internet
Author: User

Directly below the code

Verify the organization's legitimacy method    function Orgcodevalidate (value) {    if (value!= "") {    var values=value.split ("-");     var ws = [3, 7, 9, ten, 5, 8, 4, 2];       var str = ' 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ ';       var reg =/^ ([0-9a-z]) {8}$/;        if (!reg.test (Values[0])) {           return True       }       var sum = 0;       for (var i = 0; i < 8; i++) {           sum + = Str.indexof (Values[0].charat (i)) * ws[i];       }       var C9 = one-(sum% one);     var yc9=values[1]+ ';     if (C9 = =) {       C9 = ' 0 ';       } else if (C9 = =) {       C9 = ' X '  ;     } else {       C9 = c9+ ';       }      return yc9!=c9;    }    }

Value is an organization of values such as Xxxxxxxx-x format

False is the organization code is right

True organization code is not legal

The legitimacy of JS's verification organization

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.