def _check_value(expected_value, received_value):
    """Check that the received value contains the expected value.

    Checks that the received value (a hex string) contains the expected value
    (a string). If the received value is longer than the expected value, make
    sure any remaining characters are zeros.

    Args:
        expected_value (str): the expected hex string
        received_value (str): the string to verify

    Returns:
        bool: True if the values match, False otherwise

    """
    char = None
    # Comparisons are lower case
    received_value = received_value.lower()

    # Convert the expected value to hex characters
    expected_value_hex = "".join(
        "{:02x}".format(ord(c)) for c in expected_value).lower()

    # Make sure received value is at least as long as expected
    if len(received_value) < len(expected_value_hex):
        return False

    # Make sure received value starts with the expected value
    if expected_value_hex not in received_value[:len(expected_value_hex)]:
        return False

    # Make sure all characters after the expected value are zeros (if any)
    for char in received_value[len(expected_value_hex):]:
        if char != "0":
            return False

    return True