Md5加密

  public static void main(String[] args) throws Exception
{
MessageDigest md5 = MessageDigest.getInstance("MD5");
String password = "wodemima";
byte[] bytes = md5.digest(password.getBytes());
String result = "";
for(byte b : bytes)
{
String temp = Integer.toHexString(b & 0xff);
if(temp.length() == 1)
{
temp = "0" + temp;
}
result = result + temp;
}
System.out.println(result);
}
  //输出显示:fb2744d1e419813ade40ef0a97c5261f

原文地址:https://www.cnblogs.com/nankeyimengningchenlun/p/9041649.html