Here you can find the source of byteArray2Hex(byte[] hash)
private static String byteArray2Hex(byte[] hash)
//package com.java2s; //License from project: Apache License import java.util.Formatter; public class Main { private static String byteArray2Hex(byte[] hash) { Formatter formatter = new Formatter(); for (byte b : hash) { formatter.format("%02x", b); }//from w ww . j a v a 2 s . co m return formatter.toString(); } }