def convert_version_string_to_int(string, number_bits):
    """
    Take in a verison string e.g. '3.0.1'
    Store it as a converted int:
    3 * (2**number_bits[0]) + 0 * (2**number_bits[1]) + 1 * (2**number_bits[2])

    >>> convert_version_string_to_int('3.0.1',[8,8,16])
    50331649
    """
    # This is needed for using Version as a type in pydantic
    if string == Ellipsis: return string
        
    numbers = [int(number_string) for number_string in string.split(".")]

    if len(numbers) > len(number_bits):
        raise NotImplementedError(
            "Versions with more than {0} decimal places are not supported"
            .format(len(number_bits) - 1)
        )

    # add 0s for missing numbers
    numbers.extend([0] * (len(number_bits) - len(numbers)))

    # convert to single int and return
    number = 0
    total_bits = 0
    for num, bits in reversed(list(zip(numbers, number_bits))):
        max_num = (bits + 1) - 1
        if num >= 1 << max_num:
            raise ValueError(
                "Number {0} cannot be stored with only {1} bits. Max is {2}"
                .format(num, bits, max_num)
            )
        number += num << total_bits
        total_bits += bits

    return number