Here you can find the source of md5(String input)
public static String md5(String input) throws NoSuchAlgorithmException
//package com.java2s; //License from project: Apache License import java.math.BigInteger; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class Main { public static String md5(String input) throws NoSuchAlgorithmException { MessageDigest md = MessageDigest.getInstance("MD5"); byte[] messageDigest = md.digest(input.getBytes()); BigInteger number = new BigInteger(1, messageDigest); String hashtext = number.toString(16); while (hashtext.length() < 32) { hashtext = "0" + hashtext; }/*from w ww. j a va 2 s. com*/ return hashtext; } }