Here you can find the source of MD5(String text)
public static byte[] MD5(String text) throws NoSuchAlgorithmException
//package com.java2s; //License from project: Apache License import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class Main { public static byte[] MD5(String text) throws NoSuchAlgorithmException { MessageDigest md = MessageDigest.getInstance("MD5"); md.update(text.getBytes());/*w ww .j ava2 s . c o m*/ return md.digest(); } }