private static final char[] hexChars = { '0', '1', '2', '3', '4', '5', '6',
'7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
public static String MD5(String str) {
try {
MessageDigest md = MessageDigest.getInstance("MD5");
md.update(str.getBytes());
return hexStringFromBytes(md.digest());
} catch (Exception e) {
e.printStackTrace();
return "";
}
}