查看单个帖子
旧 2005-05-11   #18
ultima
高级会员
级别:10 | 在线时长:290小时 | 升级还需:40小时级别:10 | 在线时长:290小时 | 升级还需:40小时级别:10 | 在线时长:290小时 | 升级还需:40小时级别:10 | 在线时长:290小时 | 升级还需:40小时
 
ultima 的头像
 
注册: 02年05月24日
来自: 梦幻国度
帖子: 587
声望力: 29
声望: 17 ultima 初领妙道
精华:5
现金:69880两梁山币
资产:69880两梁山币
致谢数: 0
获感谢文章数:0
获会员感谢数:0
回复: 没有人玩国内wowonline吗?

csheng 自己计算一个身份证号码出来吧

我们要验证身份证号是否正确,就得先了解身份证号的含意。

身份证号都代表什么意思?

1、号码的结构
公民身份号码是特征组合码,由十七位数字本体码和一位校验码组成。排列顺序从左至右依次为:六位数字地址码,八位数字出生日期码,三位数字顺序码和一位数字校验码。

2、地址码(前六位数)
表示编码对象常住户口所在县(市、旗、区)的行政区划代码,按GB/T2260的规定执行。

3、出生日期码(第七位至十四位)
表示编码对象出生的年、月、日,按GB/T7408的规定执行,年、月、日代码之间不用分隔符。

4、顺序码(第十五位至十七位)
表示在同一地址码所标识的区域范围内,对同年、同月、同日出生的人编定的顺序号,顺序码的奇数分配给男性,偶数分配给女性。

5、校验码(第十八位数)
(1)十七位数字本体码加权求和公式
S = Sum(Ai * Wi), i = 0, ... , 16 ,先对前17位数字的权求和
Ai:表示第i位置上的身份证号码数字值
Wi:表示第i位置上的加权因子
Wi: 7 9 10 5 8 4 2 1 6 3 7 9 10 5 8 4 2
(2)计算模
Y = mod(S, 11)
(3)通过模得到对应的校验码
Y: 0 1 2 3 4 5 6 7 8 9 10
校验码: 1 0 X 9 8 7 6 5 4 3 2

所以我们就可以大致写一个函数来校验是否正确了。

What is real? How do you define real? If you're talking about what you can
feel, what you can smell, what you can taste and see, then real is simply
electrical signals interpreted by your brain.

- Morpheus, The Matrix

It came to me when I tried to classify your species. I realized that you're
not actually mammals. Every mammal on this planet instinctively develops a
natural equilibrium with the surrounding environment but you humans
do not. You move to an area and you multiply and multiply until every
natural resource is consumed. The only way you can survive is to spread to
another area. There is another organism on this planet that follows the same
pattern. Do you know what it is? A virus. Human beings are a disease, a
cancer of this planet. You are a plague, and we are the cure.

- Agent Smith, The Matrix
帅哥 ultima 当前离线  
回复时引用此帖