def stringToBinary(seq):
    """
    Converts a string sequence to binary representation (length, number)
    """
    length = len(seq)
    number = 0
    digit = 1
    for i in reversed(range(length)):
        number += int(seq[i]) * digit
        digit *= 2
    return length, number
