Here you can find the source of MD5(String input)
public static String MD5(String input)
//package com.java2s; //License from project: LGPL import java.security.MessageDigest; public class Main { public static String MD5(String input) { StringBuffer md5Hash = new StringBuffer(32); try {//w w w . j a v a2 s .co m byte[] b = MessageDigest.getInstance("MD5").digest(input.getBytes()); int len = b.length; for (int x = 0; x < len; x++) { md5Hash.append(String.format("%02x", b[x])); } } catch (Exception e) { } return md5Hash.toString(); } }