Here you can find the source of md5Encode(String src)
public static String md5Encode(String src)
//package com.java2s; //License from project: Apache License import java.io.UnsupportedEncodingException; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class Main { public static final String UTF_8 = "UTF-8"; public static String md5Encode(String src) { MessageDigest md = null;//from ww w . j a v a2s. com try { md = MessageDigest.getInstance("MD5"); md.update(src.getBytes(UTF_8)); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } byte b[] = md.digest(); int i; StringBuffer buf = new StringBuffer(""); for (int offset = 0; offset < b.length; offset++) { i = b[offset]; if (i < 0) i += 256; if (i < 16) buf.append("0"); buf.append(Integer.toHexString(i)); } return buf.toString(); } }