Here you can find the source of toHexadecimal(byte[] digest)
Parameter | Description |
---|---|
digest | arreglo de bytes a convertir |
digest
private static String toHexadecimal(byte[] digest)
//package com.java2s; //License from project: Open Source License public class Main { /***//from w w w .j av a2 s .com * Convierte un arreglo de bytes a String usando valores hexadecimales * @param digest arreglo de bytes a convertir * @return String creado a partir de <code>digest</code> */ 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); } return hash; } }