Here you can find the source of md5(String key)
public static byte[] md5(String key)
//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 byte[] md5(String key) { MessageDigest algorithm;// www.j ava 2 s . c o m try { algorithm = MessageDigest.getInstance("MD5"); } catch (NoSuchAlgorithmException ex) { throw new RuntimeException(ex); } algorithm.reset(); try { algorithm.update(key.getBytes("UTF-8")); } catch (UnsupportedEncodingException ex) { throw new RuntimeException(ex); } return algorithm.digest(); } }