Here you can find the source of toHexString(byte[] digest)
Parameter | Description |
---|---|
digest | a parameter |
private static String toHexString(byte[] digest)
//package com.java2s; //License from project: Apache License public class Main { /**//from w w w . j a va2 s .c o m * byte to hex * @param digest * @return */ private static String toHexString(byte[] digest) { String str = ""; String tempStr = ""; for (int i = 0; i < digest.length; i++) { tempStr = (Integer.toHexString(digest[i] & 0xff)); if (tempStr.length() == 1) str = str + "0" + tempStr; else str = str + tempStr; } return str.toLowerCase(); } }