Here you can find the source of toHexDigit(int h)
private static char toHexDigit(int h)
//package com.java2s; //License from project: Apache License public class Main { private static char toHexDigit(int h) { char out; if (h <= 9) out = (char) (h + 0x30); else//from www . j a v a 2 s . c om out = (char) (h + 0x37); //System.err.println(h + ": " + out); return out; } }