Here you can find the source of hexMD5(String input)
public static String hexMD5(String input)
//package com.java2s; //License from project: Open Source License import java.security.MessageDigest; public class Main { public static String hexMD5(String input) { MessageDigest digester;/* w w w. j a v a 2 s . co m*/ byte[] bInput; try { digester = MessageDigest.getInstance("MD5"); bInput = input.getBytes("UTF-8"); } catch (Exception notgonnahappen) { // NoSuchAlgorithmException|UnsupportedEncodingException throw new RuntimeException(notgonnahappen); } byte[] bOutput = digester.digest(bInput); StringBuilder hexOutputBuilder = new StringBuilder( bOutput.length * 2); for (byte b : bOutput) { hexOutputBuilder.append(Integer.toHexString((0xFF & b) | 0x100) .substring(1, 3)); } return hexOutputBuilder.toString(); } }