1 public static String makeMD5(String password) {
2 String result = null;
3
4 MessageDigest messageDigest;
5 try {
6 messageDigest = MessageDigest.getInstance("MD5");
7 messageDigest.update(password.getBytes());
8 result = new BigInteger(1, messageDigest.digest()).toString(16);
9 } catch (Exception e) {
10 e.printStackTrace();
11 }
12 return result;
13 }
md5 对字符串进行加密的方法 简单好用,码迷,mamicode.com
时间: 2024-12-24 09:32:49