MessageDigest md = MessageDigest.getInstance("MD5");
byte[] md5Bytes = md.digest(src.getBytes());
System.out.println(Hex.encodeHexString(md5Bytes));//将密文转为十六进制显示
byte[] md5Bytes = md.digest(src.getBytes());
System.out.println(Hex.encodeHexString(md5Bytes));//将密文转为十六进制显示
2015-01-30
jdk中的提供的md5加密算法例子:
MessageDigest md = MessageDigest.getInstance("MD5");
byte[] md5Bytes = md.digest(src.getBytes());
System.out.println(Hex.encodeHexString(md5Bytes));//将密文转为十六进制显示
MessageDigest md = MessageDigest.getInstance("MD5");
byte[] md5Bytes = md.digest(src.getBytes());
System.out.println(Hex.encodeHexString(md5Bytes));//将密文转为十六进制显示
2015-01-29