Here you can find the source of md5(final byte[] bytes)
public static byte[] md5(final byte[] bytes)
//package com.java2s; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class Main { /** Gets the given byte array's MD5 checksum, or null if unavailable. */ public static byte[] md5(final byte[] bytes) { return digest("MD5", bytes); }//from w w w. j a v a 2 s . c om /** * Gets the given byte array's hash value according to the specified * algorithm. * * @param algorithm The algorithm to use when generating the hash value. * @param bytes The byte array for which to compute the hash value. * @return The computed hash value, or null if the digest algorithm is not * available. * @see MessageDigest */ public static byte[] digest(final String algorithm, final byte[] bytes) { try { final MessageDigest digest = MessageDigest.getInstance(algorithm); digest.update(bytes); return digest.digest(); } catch (final NoSuchAlgorithmException exc) { return null; } } }