Java realizes 15 digits of ID card

xiaoxiao2021-03-06  91

Public static final string getnewid (string id) {final int [] w = {7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2 , 1}; Final String [] A = {"1", "0", "x", "9", "8", "7", "6", "5", "4", "3" , "2"}; INT I, J, S = 0; string newid; newid = id; newid = newid.substring (0,6) "19" newid.substring (6, id.length ()); For (i = 0; i

J = integer.parseint (newid.substring (i, i 1)) * w [i]; s = s j;} S = S% 11; newid = newid a [s]; return new;}

转载请注明原文地址:https://www.9cbs.com/read-122076.html

New Post(0)