import java.security.MessageDigest;
public class MD5Utils {
public static String getMD5String(String s){
StringBuffer result = new StringBuffer();
try {
MessageDigest md5 = MessageDigest.getInstance("MD5");
md5.update(s.getBytes());
for (byte tmp: md5.digest()
) {
result.append(String.format("%02X", tmp));
}
}catch (Exception e){
}
return result.toString();
}
}
Java生成MD5加密字符串
最新推荐文章于 2024-09-11 16:36:24 发布