身份证号码的验证(Verification of ID number).doc

身份证号码的验证(Verification of ID number).doc

  1. 1、本文档共9页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
身份证号码的验证(Verification of ID number)

身份证号码的验证(Verification of ID number) In the software development, if it involves the ID card number, it is often necessary to verify the identity card code. At present, our citizenship cards are two generation ID cards, and their numbers are eighteen. The eighteen digit in the top six for the area code, said the members of the native place, eight followed by the civil code and the next birthday, three for police serial number, the odd among male citizens, even to the female citizens. The last bit is the end identifier, which identifies the first seventeen digits. The ID number of the top seventeen respectively (7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2) for the corresponding multiplication, the sum of each product, divided by 11 to take the remainder, the remainder is 0 10, at the end of the corresponding identification codes were:1,0,X,9,8,7,6,5,4,3,2, where X is 10, the ID number are limited to a length of 18, if 10, then broke the ID code length 18 limit, therefore, the Rome digital X said 10. Specific implementation methods can refer to the following C language code. Char passID (char *); Int strtonum (char *); Char dateyn (char *); Void, main () { Char i; Char info[][7]={error, not recognized, normal}; Char ID[]= 510108050229502 / / to use this number to test; Char id[19]; Memcpy (ID, ID, sizeof (ID)); I=passID (ID); Printf (%s, %s, %s\n, Id, ID, info[i+1]); WaitKey (); } Char passID (char *ID) / / determine the parameters provided by the identity card number is correct, if the number 15 and the number is correct, the 18 digit number corresponding to the write pointer parameters {// returns 0 number, 1 right, -1 error, -2 ID code Char id[19]; Char score[]={7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2}; / / check code Char str[]={1,0,X,9,8,7,6,5,4,3,2}; / / end code Char I; / / loop variable Int k; / / check value Char city[7], birthday[9], end[4]; / / area code, code code at the end of the birthday. If (strlen (ID) ==0 return 0); / / does not pr

文档评论(0)

jgx3536 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

版权声明书
用户编号:6111134150000003

1亿VIP精品文档

相关文档