public static String encrypt_md5(String srcStr)
{
String hexStr="0123456789abcdef";
String result="";
try
{
java.security.MessageDigest md5=java.security.MessageDigest.getInstance("MD5");
md5.update(srcStr.getBytes());
byte bytes[]=md5.digest();
for(int i=0;i<bytes.length;i++)
{
int temp=bytes[i]<0?bytes[i]+256:bytes[i];
result=result+hexStr.charAt((temp/16)%16)+hexStr.charAt(temp%16);
}
}
catch(Exception e)
{
System.out.println(e.getMessage());
e.printStackTrace();
}
return result;
}
{
String hexStr="0123456789abcdef";
String result="";
try
{
java.security.MessageDigest md5=java.security.MessageDigest.getInstance("MD5");
md5.update(srcStr.getBytes());
byte bytes[]=md5.digest();
for(int i=0;i<bytes.length;i++)
{
int temp=bytes[i]<0?bytes[i]+256:bytes[i];
result=result+hexStr.charAt((temp/16)%16)+hexStr.charAt(temp%16);
}
}
catch(Exception e)
{
System.out.println(e.getMessage());
e.printStackTrace();
}
return result;
}