2024年3月21日发(作者:)
String com = "yunda";
//快递单号
String num = "395";
String expressMessage = getExpressMessage(com, num);
n(expressMessage);
}*/
}
/**
* md5加密
*/
class MD5Util {
private static MessageDigest mdigest = null;
private static char digits[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
private static MessageDigest getMdInst() {
if (null == mdigest) {
try {
mdigest = tance("MD5");
} catch (NoSuchAlgorithmException e) {
tackTrace();
}
}
return mdigest;
}
public static String encode(String s) {
if(null == s) {
return "";
}
try {
byte[] bytes = es();
getMdInst().update(bytes);
byte[] md = getMdInst().digest();
int j = ;
char str[] = new char[j * 2];
int k = 0;
for (int i = 0; i < j; i++) {
byte byte0 = md[i];
str[k++] = digits[byte0 >>> 4 & 0xf];
str[k++] = digits[byte0 & 0xf];
}
return new String(str);
} catch (Exception e) {
tackTrace();
return null;
}
}
}


发布评论