Here you can find the source of md5(byte[] input)
public static String md5(byte[] input)
//package com.java2s; //License from project: Apache License import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class Main { private static final char[] HEXDICT = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; public static String md5(byte[] input) { if (input == null) return null; try {/* w w w .j a va2 s . c o m*/ MessageDigest algorithm = MessageDigest.getInstance("MD5"); algorithm.reset(); algorithm.update(input); byte[] messageDigest = algorithm.digest(); return byteArrayToHexString(messageDigest); } catch (NoSuchAlgorithmException e) { } return null; } public static String byteArrayToHexString(byte[] byteArray) { String result = ""; int len = byteArray.length; for (int i = 0; i < len; ++i) { byte b = byteArray[i]; result = result + HEXDICT[(b >>> 4 & 0xF)]; result = result + HEXDICT[(b & 0xF)]; } return result; } }