md5加密封装的方法(java)
1.创建一个工具类PasswordSaltUtil
public static final String
[] md5(String password
, String salt
) {
String
[] result
=new String[2];
String name
= "MD5";
ByteSource byteSalt
= ByteSource
.Util
.bytes(salt
);
int number
= 5;
SimpleHash resultTemp
= new SimpleHash(name
, password
, byteSalt
, number
);
result
[0] = byteSalt
.toString();
result
[1] = resultTemp
.toString();
return result
;
}
2.直接在你的类中调用这个方法即可.
转载请注明原文地址: https://mac.8miu.com/read-492225.html