Here you can find the source of MD5(String message)
static String MD5(String message)
//package com.java2s; //License from project: Open Source License import java.math.BigInteger; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class Main { static String MD5(String message) { try {//from ww w. j a v a2 s. c o m MessageDigest m = MessageDigest.getInstance("MD5"); m.update(message.getBytes()); byte[] digest = m.digest(); BigInteger bigInt = new BigInteger(1, digest); String hash = bigInt.toString(16); // Now we need to zero pad it if you actually want the full 32 chars. while (hash.length() < 32) { hash = "0" + hash; } return hash; } catch (NoSuchAlgorithmException nsae) { return ""; } } }