{"id":13,"date":"2007-12-28T22:30:38","date_gmt":"2007-12-28T22:30:38","guid":{"rendered":""},"modified":"2007-12-28T22:30:38","modified_gmt":"2007-12-28T22:30:38","slug":"13","status":"publish","type":"post","link":"https:\/\/www.poloo.org\/?p=13","title":{"rendered":"\u4e00\u4e2a18\u4f4d\u8eab\u4efd\u8bc1\u6821\u9a8c\u8ba1\u7b97\u51fd\u6570"},"content":{"rendered":"<p>\u56e0\u9700\u8981\u5bf915\u4f4d\u65e7\u8eab\u4efd\u8bc1\u53f7\u7801\u8fdb\u884c\u5347\u4f4d\u548c\u6821\u9a8c\u3001\u67e5\u8be2\u5904\u7406\uff0c\u53c8\u6ca1\u6709\u641c\u7d22\u5230\u73b0\u6210\u7684\u51fd\u6570\uff0c\u4e8e\u662f\u81ea\u5df1\u5199\u4e86\u4e00\u4e2a\u7b80\u5355\u7684\u8fc7\u7a0b\uff0c\u5e0c\u671b\u80fd\u591f\u5e2e\u5f97\u4e0a\u9700\u8981\u7684\u670b\u53cb\u3002<br \/>\u672c\u51fd\u6570\u7684\u529f\u80fd\u5355\u4e00\uff0c\u53ea\u80fd\u6821\u9a8c\u7b2c18\u4f4d\u53f7\u7801\u662f\u5426\u6b63\u786e\u6216\u8005\u53d6\u5f97\u7b2c18\u4f4d\u53f7\u7801\uff0c\u5176\u4ed6\u529f\u80fd\u7559\u7ed9\u5927\u5bb6\u81ea\u5df1\u6269\u5c55\u5427\uff01<br \/><code><br \/>&lt;%<br \/>'&nbsp;&nbsp; Version:&nbsp;&nbsp; 1.0.1<br \/>' Author:&nbsp;&nbsp;&nbsp;&nbsp;sfply(sfply@163.com)<br \/>' Last Modified: 2004\/7\/17 12:03<br \/>' Src\u662f\u8eab\u4efd\u8bc1\u53f7\u7801,\u53ef\u4ee5\u662f15\u4f4d\u4e5f\u53ef\u4ee5\u662f18\u4f4d,15\u4f4d\u65f6\u53ea\u80fd\u8fd4\u56de\u9a8c\u8bc1\u7801\u65b9\u5f0f\u4f7f\u7528<br \/>' iChk\u53c2\u6570\u53d6\u503c\u771f\u5047,\u771f\u4ee3\u8868\u6821\u9a8cSrc\u662f\u542618\u4f4d\u8eab\u4efd\u8bc1\uff0c\u5e76\u4e14\u6821\u9a8c\u7b2c18\u4f4d\u662f\u5426\u6b63\u786e\u53f7\u7801\u800c\u786e\u5b9a\u662f\u5426\u6709\u6548\u8eab\u4efd\u8bc1,\u8fd4\u56de\u53ea\u503c\u4e3atrue\u6216false<br \/>'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\u5047\u4ee3\u8868\u8fd4\u56de\u6b63\u786e\u7684\u6821\u9a8c\u7801\uff0c\u8fd4\u56de\u503c\u4e3a(1~x)<br \/>dim myIdentify<br \/>myIdentify = \"36050219781218133?\"<\/p>\n<p>response.write chkIdentiyCard(myIdentify,false)<\/p>\n<p>Function chkIdentiyCard(Src,iChk)<br \/>dim myWi,myAi,mySrc(17),i,myCount<br \/>myAi = \"10X98765432\"<br \/>myWi = split(\"7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2\",\",\")<br \/>if iChk then<br \/>&nbsp;&nbsp; if len(Src) = 18 then<br \/>&nbsp;&nbsp;&nbsp;&nbsp;for i = 0 to 16<br \/>&nbsp;&nbsp;&nbsp;&nbsp; mySrc(i) = mid(Src,i+1,1)<br \/>&nbsp;&nbsp;&nbsp;&nbsp; myCount = myCount + mySrc(i) * myWi(i)<br \/>&nbsp;&nbsp;&nbsp;&nbsp;next<br \/>&nbsp;&nbsp;&nbsp;&nbsp;if mid(myAi,(mycount mod 11)+1,1) = right(Src,1) then<br \/>&nbsp;&nbsp;&nbsp;&nbsp; chkIdentiyCard = true&nbsp;&nbsp; '\u8fd4\u56de\u7ed3\u679c\uff0cTRUE\u4e3a\u5408\u6cd5\u8eab\u4efd\u8bc1\u9a8c\u8bc1\u7801<br \/>&nbsp;&nbsp;&nbsp;&nbsp;else<br \/>&nbsp;&nbsp;&nbsp;&nbsp; chkIdentiyCard = false&nbsp;&nbsp; '\u8fd4\u56de\u7ed3\u679c\uff0cFALSE\u4e3a\u975e\u6cd5\u8eab\u4efd\u8bc1\u9a8c\u8bc1\u7801<br \/>&nbsp;&nbsp;&nbsp;&nbsp;end if<br \/>&nbsp;&nbsp; else<br \/>&nbsp;&nbsp;&nbsp;&nbsp;chkIdentiyCard = false&nbsp;&nbsp;&nbsp;&nbsp;'\u56e0\u4e3a\u4e0d\u662f18\u4f4d\u8eab\u4efd\u8bc1\u6240\u4ee5\u8fd4\u56deFALSE<br \/>&nbsp;&nbsp; end if<br \/>else<br \/>&nbsp;&nbsp; if len(Src) = 15 or len(Src) = 18 then<br \/>&nbsp;&nbsp;&nbsp;&nbsp;if len(Src) = 15 then Src = mid(Src,1,6) & \"19\" & mid(Src,7,9)<br \/>&nbsp;&nbsp;&nbsp;&nbsp;for i = 0 to 16<br \/>&nbsp;&nbsp;&nbsp;&nbsp; mySrc(i) = mid(Src,i+1,1)<br \/>&nbsp;&nbsp;&nbsp;&nbsp; myCount = myCount + mySrc(i) * myWi(i)<br \/>&nbsp;&nbsp;&nbsp;&nbsp;next<br \/>&nbsp;&nbsp;&nbsp;&nbsp;chkIdentiyCard = mid (myAi,(mycount mod 11)+1,1) '\u8fd4\u56de\u6b63\u786e\u7684\u9a8c\u8bc1\u7801<br \/>&nbsp;&nbsp; else<br \/>&nbsp;&nbsp;&nbsp;&nbsp;chkIdentiyCard = false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '\u8f93\u5165\u4e0d\u4e0d\u662f15\u4f4d\u621618\u4f4d\u8eab\u4efd\u8bc1\u53f7<br \/>&nbsp;&nbsp; end if&nbsp;&nbsp;<br \/>end if <br \/>End Function<br \/>%&gt;<br \/><\/code><br \/>\u5173\u4e8e\u8eab\u4efd\u8bc1\u7b2c18\u662f\u600e\u4e48\u8ba1\u7b97\u7684\uff0c\u539f\u7406\u5982\u4e0b<\/p>\n<p>&nbsp;&nbsp; \u6839\u636e\u3016\u4e2d\u534e\u4eba\u6c11\u5171\u548c\u56fd\u56fd\u5bb6\u6807\u51c6 GB 11643-1999\u3017\u4e2d\u6709\u5173\u516c\u6c11\u8eab\u4efd\u53f7\u7801\u7684\u89c4\u5b9a\uff0c\u516c\u6c11\u8eab\u4efd\u53f7\u7801\u662f\u7279\u5f81\u7ec4\u5408\u7801\uff0c\u7531\u5341\u4e03\u4f4d\u6570\u5b57\u672c\u4f53\u7801\u548c\u4e00\u4f4d\u6570\u5b57\u6821\u9a8c\u7801\u7ec4\u6210\u3002\u6392\u5217\u987a\u5e8f\u4ece\u5de6\u81f3\u53f3\u4f9d\u6b21\u4e3a\uff1a\u516d\u4f4d\u6570\u5b57\u5730\u5740\u7801\uff0c\u516b\u4f4d\u6570\u5b57\u51fa\u751f\u65e5\u671f\u7801\uff0c\u4e09\u4f4d\u6570\u5b57\u987a\u5e8f\u7801\u548c\u4e00\u4f4d\u6570\u5b57\u6821\u9a8c\u7801\u3002 <\/p>\n<p>&nbsp;&nbsp; \u5730\u5740\u7801\u8868\u793a\u7f16\u7801\u5bf9\u8c61\u5e38\u4f4f\u6237\u53e3\u6240\u5728\u53bf(\u5e02\u3001\u65d7\u3001\u533a)\u7684\u884c\u653f\u533a\u5212\u4ee3\u7801\u3002\u751f\u65e5\u671f\u7801\u8868\u793a\u7f16\u7801\u5bf9\u8c61\u51fa\u751f\u7684\u5e74\u3001\u6708\u3001\u65e5\uff0c\u5176\u4e2d\u5e74\u4efd\u7528\u56db\u4f4d\u6570\u5b57\u8868\u793a\uff0c\u5e74\u3001\u6708\u3001\u65e5\u4e4b\u95f4\u4e0d\u7528\u5206\u9694\u7b26\u3002\u987a\u5e8f\u7801\u8868\u793a\u540c\u4e00\u5730\u5740\u7801\u6240\u6807\u8bc6\u7684\u533a\u57df\u8303\u56f4\u5185\uff0c\u5bf9\u540c\u5e74\u3001\u6708\u3001\u65e5\u51fa\u751f\u7684\u4eba\u5458\u7f16\u5b9a\u7684\u987a\u5e8f\u53f7\u3002\u987a\u5e8f\u7801\u7684\u5947\u6570\u5206\u7ed9\u7537\u6027\uff0c\u5076\u6570\u5206\u7ed9\u5973\u6027\u3002\u6821\u9a8c\u7801\u662f\u6839\u636e\u524d\u9762\u5341\u4e03\u4f4d\u6570\u5b57\u7801\uff0c\u6309\u7167ISO 7064:1983.MOD 11-2\u6821\u9a8c\u7801\u8ba1\u7b97\u51fa\u6765\u7684\u68c0\u9a8c\u7801\u3002\u4e0b\u9762\u4e3e\u4f8b\u8bf4\u660e\u8be5\u8ba1\u7b97\u65b9\u6cd5\u3002 <\/p>\n<p>&nbsp;&nbsp; 15\u4f4d\u7684\u8eab\u4efd\u8bc1\u7f16\u7801\u9996\u5148\u628a\u51fa\u751f\u5e74\u6269\u5c55\u4e3a4\u4f4d\uff0c\u7b80\u5355\u7684\u5c31\u662f\u589e\u52a0\u4e00\u4e2a19\uff0c\u4f46\u662f\u8fd9\u5bf9\u4e8e1900\u5e74\u51fa\u751f\u7684\u4eba\u4e0d\u4f7f\u7528\uff08\u8fd9\u6837\u7684\u5bff\u661f\u4e0d\u591a\u4e86\uff09<\/p>\n<p>&nbsp;&nbsp; \u67d0\u7537\u6027\u516c\u6c11\u8eab\u4efd\u53f7\u7801\u672c\u4f53\u7801\u4e3a34052419800101001\uff0c\u9996\u5148\u6309\u7167\u516c\u5f0f\u2474\u8ba1\u7b97\uff1a <\/p>\n<p>&nbsp;&nbsp; \u2211(ai\u00d7Wi)(mod 11)\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026(1) <\/p>\n<p>&nbsp;&nbsp; \u516c\u5f0f(1)\u4e2d\uff1a<br \/>&nbsp;&nbsp; i&#8212;-\u8868\u793a\u53f7\u7801\u5b57\u7b26\u4ece\u7531\u81f3\u5de6\u5305\u62ec\u6821\u9a8c\u7801\u5728\u5185\u7684\u4f4d\u7f6e\u5e8f\u53f7\uff1b<br \/>&nbsp;&nbsp; ai&#8212;-\u8868\u793a\u7b2ci\u4f4d\u7f6e\u4e0a\u7684\u53f7\u7801\u5b57\u7b26\u503c\uff1b<br \/>&nbsp;&nbsp; Wi&#8212;-\u793a\u7b2ci\u4f4d\u7f6e\u4e0a\u7684\u52a0\u6743\u56e0\u5b50\uff0c\u5176\u6570\u503c\u4f9d\u636e\u516c\u5f0fWi=2\uff08n-1\uff09(mod 11)\u8ba1\u7b97\u5f97\u51fa\u3002 <\/p>\n<p>&nbsp;&nbsp; i 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 <\/p>\n<p>&nbsp;&nbsp; ai 3 4 0 5 2 4 1 9 8 0 0 1 0 1 0 0 1 a1 <\/p>\n<p>&nbsp;&nbsp; Wi 7 9 10 5 8 4 2 1 6 3 7 9 10 5 8 4 2 1 <\/p>\n<p>&nbsp;&nbsp; ai\u00d7Wi 21 36 0 25 16 16 2 9 48 0 0 9 0 5 0 0 2 a1 <\/p>\n<p>&nbsp;&nbsp; \u6839\u636e\u516c\u5f0f(1)\u8fdb\u884c\u8ba1\u7b97\uff1a <\/p>\n<p>&nbsp;&nbsp; \u2211(ai\u00d7Wi) =\uff0821+36+0+25+16+16+2+9+48++0+0+9+0+5+0+0+2) = 189 <\/p>\n<p>&nbsp;&nbsp; 189 \u00f7 11 = 17 + 2\/11 <\/p>\n<p>&nbsp;&nbsp; \u2211(ai\u00d7Wi)(mod 11) = 2 <\/p>\n<p>&nbsp;&nbsp; \u7136\u540e\u6839\u636e\u8ba1\u7b97\u7684\u7ed3\u679c\uff0c\u4ece\u4e0b\u9762\u7684\u8868\u4e2d\u67e5\u51fa\u76f8\u5e94\u7684\u6821\u9a8c\u7801\uff0c\u5176\u4e2dX\u8868\u793a\u8ba1\u7b97\u7ed3\u679c\u4e3a10\uff1a <\/p>\n<p>&nbsp;&nbsp; \u2211(ai\u00d7WI)(mod 11) 0 1 2 3 4 5 6 7 8 9 10 <br \/>&nbsp;&nbsp; \u6821\u9a8c\u7801\u5b57\u7b26\u503cai 1 0 X 9 8 7 6 5 4 3 2<br \/>&nbsp;&nbsp; \u6839\u636e\u4e0a\u8868\uff0c\u67e5\u51fa\u8ba1\u7b97\u7ed3\u679c\u4e3a2\u7684\u6821\u9a8c\u7801\u4e3a\u6240\u4ee5\u8be5\u4eba\u5458\u7684\u516c\u6c11\u8eab\u4efd\u53f7\u7801\u5e94\u8be5\u4e3a 34052419800101001X\u3002 <\/p>\n<p>&nbsp;&nbsp; a[0]*7+a[1]*9+a[2]*10+a[3]*5+a[4]*8+a[5]*4+a[6]*2+a[7]*1+a[8]*6+a[9]*3<br \/>&nbsp;&nbsp; +a[10]*7+a[11]*9+a[12]*10+a[13]*5+a[14]*8+a[15]*4+a[16]*2<br \/>&nbsp;&nbsp; %11<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u56e0\u9700\u8981\u5bf915\u4f4d\u65e7\u8eab\u4efd\u8bc1\u53f7\u7801\u8fdb\u884c\u5347\u4f4d\u548c\u6821\u9a8c\u3001\u67e5\u8be2\u5904\u7406\uff0c\u53c8\u6ca1\u6709\u641c\u7d22\u5230\u73b0\u6210&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-13","post","type-post","status-publish","format-standard","hentry","category-Dream"],"_links":{"self":[{"href":"https:\/\/www.poloo.org\/index.php?rest_route=\/wp\/v2\/posts\/13","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.poloo.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.poloo.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.poloo.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.poloo.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=13"}],"version-history":[{"count":0,"href":"https:\/\/www.poloo.org\/index.php?rest_route=\/wp\/v2\/posts\/13\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.poloo.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=13"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.poloo.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=13"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.poloo.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=13"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}