Here you can find the source of byteArray2Hex(final byte[] hash)
Parameter | Description |
---|---|
input | Byte array to hex encode |
private static String byteArray2Hex(final byte[] hash)
//package com.java2s; //License from project: Apache License import java.util.Formatter; public class Main { /**/* w w w . j a va 2 s.c om*/ * Converts an input byte array to a hex encoded String. * * @param input Byte array to hex encode * @return Hex encoded String of the input byte array */ private static String byteArray2Hex(final byte[] hash) { Formatter formatter = new Formatter(); for (byte b : hash) { formatter.format("%02x", b); } return formatter.toString(); } }