Here you can find the source of toHexDigit(int d)
private static char toHexDigit(int d)
//package com.java2s; /*//w w w. j a v a 2s.c o m * Copyright (c) Nmote d.o.o. 2003-2015. All rights reserved. * See LICENSE.txt for licensing information. */ public class Main { private static char toHexDigit(int d) { switch (d) { case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: return (char) ('0' + d); case 10: case 11: case 12: case 13: case 14: case 15: return (char) ('a' + d - 10); default: throw new IllegalArgumentException("Not a hex digit: " + d); } } }