Here you can find the source of md5(byte[] md5)
public static byte[] md5(byte[] md5)
//package com.java2s; //License from project: Apache License import java.security.MessageDigest; public class Main { public static byte[] md5(byte[] md5) { try {/* w ww . j av a 2 s . co m*/ return MessageDigest.getInstance("MD5").digest(md5); } catch (Exception e) { } return md5; } public static String md5(String str) { try { MessageDigest md = MessageDigest.getInstance("MD5"); md.update(str.getBytes()); byte b[] = md.digest(); int i; StringBuilder buf = new StringBuilder(""); for (int offset = 0; offset < b.length; offset++) { i = b[offset]; if (i < 0) i += 256; if (i < 16) buf.append("0"); buf.append(Integer.toHexString(i)); } str = buf.toString(); } catch (Exception e) { e.printStackTrace(); } return str; } }