def get_checksum(state):
    """Get checksum from the state.

    Compares pairs of characters, passing 1 to checksum if they are the same
    0 otherwise. Process repeats until length of checksum is odd.
    """
    checksum = []
    for index, _ in enumerate(state[::2]):
        if state[index * 2] == state[index * 2 + 1]:
            checksum.append('1')
        else:
            checksum.append('0')
    if len(checksum) % 2 == 0:
        return get_checksum(checksum)
    return ''.join(checksum)