标签:app except print md5 class iges ack tst div
public static String md5(String string) {
try {
MessageDigest messageDigest = MessageDigest.getInstance("MD5");
messageDigest.update(string.getBytes());
StringBuilder builder = new StringBuilder();
for (byte b1 : messageDigest.digest()) {
int temp = b1;
if (temp < 0) temp += 256;
if (temp < 16) builder.append("0");
builder.append(Integer.toHexString(temp));
}
return builder.toString();
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
return string;
}
标签:app except print md5 class iges ack tst div
原文地址:https://www.cnblogs.com/StarUDream/p/9045549.html