Here you can find the source of toHexHashString(byte[] id)
public static String toHexHashString(byte[] id)
//package com.java2s; //License from project: Apache License public class Main { private static final char[] HEX_CHARS = "0123456789abcdef".toCharArray(); public static String toHexHashString(byte[] id) { StringBuilder sb = new StringBuilder(20); assert (id.length == 20); for (int i = 0; i < 20; i++) { int val = id[i] & 0xff; sb.append(HEX_CHARS[val >> 4]); sb.append(HEX_CHARS[val & 0xf]); }//from w w w. ja v a 2 s . c om return sb.toString(); } }