Here you can find the source of hashToString(byte hash[])
public static String hashToString(byte hash[])
//package com.java2s; //License from project: Open Source License public class Main { public static String hashToString(byte hash[]) { StringBuilder sb = new StringBuilder(); for (byte b : hash) { int nibble1 = (b & 0xF0) >> 4; int nibble2 = b & 0x0F; sb.append(Integer.toHexString(nibble1)); sb.append(Integer.toHexString(nibble2)); }/* w w w .ja v a 2s. c om*/ return sb.toString(); } }