Here you can find the source of md5digest(String key)
public static byte[] md5digest(String key)
//package com.java2s; //License from project: Apache License import java.security.MessageDigest; public class Main { private static MessageDigest md5Digest = null; public static byte[] md5digest(String key) { if (key == null) { return null; }/*from w ww.jav a2s . c om*/ MessageDigest md5; try { md5 = (MessageDigest) md5Digest.clone(); } catch (CloneNotSupportedException e) { throw new RuntimeException("clone of MD5 not supported", e); } md5.update(key.getBytes()); return md5.digest(); } private static String digest(String key) { byte[] bs = md5digest(key); return byte2hex(bs); } private static String byte2hex(byte[] b) { String hs = ""; String stmp = ""; for (int n = 0; n < b.length; n++) { stmp = (java.lang.Integer.toHexString(b[n] & 0XFF)); if (stmp.length() == 1) { hs = hs + "0" + stmp; } else { hs = hs + stmp; } } return hs.toUpperCase(); } }