Here you can find the source of md5(String value)
public final static String md5(String value)
//package com.java2s; //License from project: Open Source License import java.security.MessageDigest; public class Main { public final static String md5(String value) { if (value == null) value = ""; try {//from ww w . ja v a 2 s . co m final MessageDigest digest = MessageDigest.getInstance("MD5"); final byte[] buffer = value.getBytes("UTF-8"); final byte[] digestBuffer = digest.digest(buffer); return new String(digestBuffer); } catch (final Exception e) { return null; } } }