Java tutorial
//package com.java2s; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class Main { public static byte[] md5(String s) throws NoSuchAlgorithmException { return md5(s.getBytes()); } public static byte[] md5(byte[] buff) throws NoSuchAlgorithmException { return MessageDigest.getInstance("MD5").digest(buff); } }