public static String md5(String pwd) {
MessageDigest md = MessageDigest.getInstance("MD5");
byte[] bs = md.digest(pwd.getBytes());
for (byte b : bs) {
int x = (b + uuid.hashCode()) & 0xff;
String hex = Integer.toHexString(x);
if (hex.length() == 1) {
hex += "0";
}
newPwd += hex;
}
} catch (Exception e) {
throw new RuntimeException(e);
}
return newPwd;
}
String md5Pwd = "";
String uuid = UUID.randomUUID().toString().replace("-", "");
MessageDigest md = MessageDigest.getInstance("MD5");
byte[] bs = md.digest(pwd.getBytes());
for (byte b : bs) {
int x = (b + uuid.hashCode()) & 0xff;
String hex = Integer.toHexString(x);
if (hex.length() == 1) {
hex += "0";
}
newPwd += hex;
}
} catch (Exception e) {
throw new RuntimeException(e);
}
return newPwd;
}