Here you can find the source of md5Hex(String message)
public static String md5Hex(String message)
//package com.java2s; //License from project: Apache License import java.security.MessageDigest; public class Main { public static String md5Hex(String message) { try {//from w w w .j a v a 2s. c o m MessageDigest md = MessageDigest.getInstance("MD5"); return hex(md.digest(message.getBytes("CP1252"))); } catch (Exception e) { } return null; } public static String hex(byte[] array) { StringBuffer sb = new StringBuffer(); for (int i = 0; i < array.length; ++i) { sb.append(Integer.toHexString((array[i] & 0xFF) | 0x100).substring(1, 3)); } return sb.toString(); } }