/** * Converts a digit into an lower-case hexadecimal character or the null character if invalid. * * @param digit a number 0 - 15 * @return the hex character for that digit or '\0' if invalid */ public static char getLowerCaseHex(final int digit) { if (digit < 0 || digit >= 16) { return '\0'; } return digit < 10 ? getNumericalDigit(digit) : getLowerCaseAlphaDigit(digit); }
/** * Converts a digit into an lowercase hexadecimal character or the null character if invalid. * * @param digit a number 0 - 15 * @return the hex character for that digit or '\0' if invalid */ public static char getLowerCaseHex(final int digit) { if (digit < 0 || digit >= 16) { return '\0'; } return digit < 10 ? getNumericalDigit(digit) : getLowerCaseAlphaDigit(digit); }