当前位置: 编程技术>java/j2ee
JAVA 18位身份证号码校验码的算法
来源: 互联网 发布时间:2014-10-16
本文导语: public static char doVerify(String id) { char pszSrc[]=id.toCharArray(); int iS = 0; int iW[]={7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2}; char szVerCode[] = new char[]{'1','0', 'X', '9', '8', '7', '6', '5', '4', '3', '2'}; int i; for(i=0;i
public static char doVerify(String id)
{
char pszSrc[]=id.toCharArray();
int iS = 0;
int iW[]={7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2};
char szVerCode[] = new char[]{'1','0', 'X', '9', '8', '7', '6', '5', '4', '3', '2'};
int i;
for(i=0;i
{
char pszSrc[]=id.toCharArray();
int iS = 0;
int iW[]={7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2};
char szVerCode[] = new char[]{'1','0', 'X', '9', '8', '7', '6', '5', '4', '3', '2'};
int i;
for(i=0;i