标题1
fjoasdf
标题2
撒法发
标题3
faf
public static String code(String str){
try {
MessageDigest md= MessageDigest.getInstance("MD5");
byte[] byteDigest = md.digest(str.getBytes());
int i;
StringBuffer buf = new StringBuffer("");
for(int offset=0;offset<byteDigest.length;offset++){
i=byteDigest[offset];
if(i<0){
i+=256;
}
if(i<16){
buf.append("0");
}
buf.append(Integer.toHexString(i));
}
//32 位加密
return buf.toString();
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
return null;
}
}
标题4
fasf
评论
1 / 1