Java tutorial
//package com.java2s; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class Main { public static byte[] toMD5(byte[] bytes) throws Exception { try { MessageDigest algorithm = MessageDigest.getInstance("MD5"); algorithm.reset(); return algorithm.digest(bytes); } catch (NoSuchAlgorithmException e) { throw new Exception(e); } } }