Here you can find the source of hashToHexString(byte[] hash)
public static String hashToHexString(byte[] hash)
//package com.java2s; public class Main { public static String hashToHexString(byte[] hash) { final StringBuilder hexString = new StringBuilder(); for (byte mdbyte : hash) { hexString.append(Integer.toHexString(0xFF & mdbyte)); }/*w w w .j ava2s . co m*/ return hexString.toString(); } }