Java tutorial
//package com.java2s; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class Main { /** * Compute the MD5 hash of the byte array provided. Does not accumulate * input. * @param in the byte array to hash * @return the MD5 hash of the byte array */ public static byte[] computeMd5Hash(byte[] in) { try { MessageDigest md5 = MessageDigest.getInstance("MD5"); return md5.digest(in); } catch (NoSuchAlgorithmException e) { throw new RuntimeException(e); } } }