- 1、本文档共11页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
身份证验证(js_javascript_代码)(身份证验证 (js _ javascript _ 代码))
身份证验证(js_javascript_代码)(身份证验证 (js _ javascript _ 代码))
/ * *
* modified the online version of leap year to determine the 18 identity card number regular expression
*
* add simple verification code
* /
/ * *
* id 15 bit encoding rules: dddddd, yymmdd, XX, P
* dddddd: area code
* yymmdd: date of birth
* xx: sequence class encoding cannot be determined
* p: sex, odd number is male, even number is female
*
* id 18 bit encoding rules: dddddd, yyyymmdd, XXX, y
* dddddd: area code
* yyyymmdd: date of birth
* xxx: sequence class encoding cannot be determined. Odd numbers are males and even numbers are females
* y: check code, which can be computed by the first 17 bits
*
* 18 digit weighting factors are (from left to right), Wi = [7, 9, 10, 8, 4, 2, 1, 6, 3, 7,, 9, 10, 5, 5, 8, 4,].]
* authentication bits Y = [1, 0, X, 9, 8, 7, 6,, 5, 4, 3, 2]
* parity check formula: Y_P = mod (sigma (Ai * Wi), 11)
* I is the number 2 to 18 from the right to left of the ID number; Y_P is the location of the check code array for the foot check code
*
* for example, a male identity card number is* sigma (Ai * Wi) = = (21+36+0+25+16+16+2+9+48++0+0+9+0+5+0+0+2) = = 189
* 189/11 Yu 2
* the remainder number 2 corresponds to X, so the ID card is qualified
*
* /
Function checkIdcard (IDcard) {
/ / error message
Var Errors = new Array (verify through), ID number is wrong , ID number, date of birth exceeds the scope or contains illegal characters , ID number verification error , identity card area illegal ;
VaR, area={11:, Beijing, 12:, Tianjin, 13:, Hebei, 14:, Shanxi, 15:, Inner Mongolia, 21:, Liaoning, 22:, Jilin,
23:, Heilongjiang, 31:, Shanghai, 32:, Jiangsu, 33:, Zhejiang, 34:, Anhui, 35:, Fujian, 36:, Jiangxi, 37:, Shandong,
41:, Henan, 42:, Hubei, 43:, Hunan, 44:, Guangdong, 45:, Guangxi, 46:, Hainan, 50:, Chongqing, 51:, Sichuan,
52:, Guizhou, 53:, Yunnan, 54:, Tibet, 61:, Shaanxi, 62:, Gansu, 63:, Qinghai, 64:, Ningxia, 65:, Xinjiang,
71: Taiwan, 81:, Hongkong, 82:, , 91:,
您可能关注的文档
- 纸币鉴定(Banknote identification).doc
- 纸尿裤文章——第五期(Diapers article - Fifth).doc
- 纸张尺寸及照片尺寸(Paper size and photo size).doc
- 纳米材料(Nanometer material).doc
- 纹章学1(Art of arms 1).doc
- 线代知识点(Line generation knowledge point).doc
- 线性代数习题解答赵树嫄(Linear algebra answers Zhao Shuyuan).doc
- 线性代数复习知识(Review knowledge of linear algebra).doc
- 线性代数复习提纲(重要公式,方法)(Linear algebra (important formula method)).doc
- 线性代数感悟(Linear algebra perception).doc
文档评论(0)