def sanitize_hex(hex_string):
    """
    Sanitize input to uppercase hex string
    :param hex_string: the input hex string, e.g. 0xabc, 0xABC, abc, 28h
    :return: sanitized hex string, e.g. ABC or 28
    """
    return ''.join(c for c in hex_string.upper() if c in '0123456789ABCDEF')