def to_hex_char(hex_value):
    """Convert an integer to a single hex digit in a character."""
    if 0 <= hex_value <= 9:
        return chr(hex_value + ord('0'))
    else:  # 10 <= hex_value <= 15
        return chr(hex_value - 10 + ord('A'))