Here you can find the source of digest(String password)
public static String digest(String password) throws Exception
//package com.java2s; //License from project: Apache License import java.security.MessageDigest; public class Main { public static String digest(String password) throws Exception { MessageDigest md = MessageDigest.getInstance("MD5"); md.update(password.getBytes());// w ww .j av a 2 s . co m byte byteData[] = md.digest(); //convert the byte to hex format method 1 StringBuffer sb = new StringBuffer(); for (int i = 0; i < byteData.length; i++) { sb.append(Integer.toString((byteData[i] & 0xff) + 0x100, 16).substring(1)); } return sb.toString(); } }