Here you can find the source of toHexadecimal(byte[] digest)
private static String toHexadecimal(byte[] digest)
//package com.java2s; //License from project: Open Source License public class Main { private static String toHexadecimal(byte[] digest) { String hash = ""; for (byte aux : digest) { int b = aux & 0xff; if (Integer.toHexString(b).length() == 1) hash += "0"; hash += Integer.toHexString(b); }//from ww w. ja v a 2s .c o m return hash; } }