Here you can find the source of bytesToModHex(final byte[] inputBytes)
public static String bytesToModHex(final byte[] inputBytes)
//package com.java2s; //License from project: Open Source License public class Main { private static final char[] MOD_HEX_DIGITS = { 'c', 'b', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'n', 'r', 't', 'u', 'v' }; public static String bytesToModHex(final byte[] inputBytes) { assert inputBytes != null; assert MOD_HEX_DIGITS != null; assert MOD_HEX_DIGITS.length == 16; StringBuilder modHexOutput = new StringBuilder(inputBytes.length * 2); for (byte b : inputBytes) { int msb = (b >> 4) & 0xf; int lsb = b & 0xf; assert msb >= 0; assert msb < MOD_HEX_DIGITS.length; assert lsb >= 0; assert lsb < MOD_HEX_DIGITS.length; modHexOutput.append(MOD_HEX_DIGITS[msb]); modHexOutput.append(MOD_HEX_DIGITS[lsb]); }//w w w . j a va 2 s . c om return modHexOutput.toString(); } }