def METHOD_NAME(number):
    """Encode the length value to a hexadecimal.
    Args:
        number (int): The number to convert.
    """
    if number <= 127:
        return to_hex(number)
    n_hex = to_hex(number)
    length = int(128 + len(n_hex) / 2)
    return to_hex(length) + n_hex