Here you can find the source of md5String(String paramString)
public static String md5String(String paramString)
//package com.java2s; //License from project: Open Source License import java.security.MessageDigest; public class Main { private static final char[] HEX_DIGITS = { 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 97, 98, 99, 100, 101, 102 }; public static String md5String(String paramString) { try {/*from ww w . jav a 2s . c o m*/ MessageDigest localMessageDigest = MessageDigest .getInstance("MD5"); localMessageDigest.update(paramString.getBytes("UTF-8"), 0, paramString.length()); String str = toHexString(localMessageDigest.digest()); return str; } catch (Exception localException) { } return ""; } public static String toHexString(byte[] paramArrayOfByte) { if (paramArrayOfByte == null) return ""; StringBuilder localStringBuilder = new StringBuilder( paramArrayOfByte.length << 1); for (int i = 0;; i++) { if (i >= paramArrayOfByte.length) return localStringBuilder.toString(); localStringBuilder .append(HEX_DIGITS[((0xF0 & paramArrayOfByte[i]) >>> 4)]); localStringBuilder .append(HEX_DIGITS[(0xF & paramArrayOfByte[i])]); } } }