Here you can find the source of md5sum(byte[] content)
public static String md5sum(byte[] content) throws NoSuchAlgorithmException
//package com.java2s; //License from project: Open Source License import java.math.BigInteger; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class Main { public static String md5sum(byte[] content) throws NoSuchAlgorithmException { MessageDigest md5 = MessageDigest.getInstance("MD5"); byte[] md5raw = md5.digest(content); return md5ConvertDigest(md5raw); }//from w ww . j av a2s. c o m public static String md5ConvertDigest(byte[] digest) { return toHex(digest, 32); } public static String toHex(byte[] digest, int length) { BigInteger bitInt = new BigInteger(1, digest); String hashText = bitInt.toString(16); while (hashText.length() < length) { hashText = "0" + hashText; } return hashText; } }