def largest_differing_bit(value1, value2):
    """
    Returns index(from 0 to 127) of largest differing bit: Eg. for argument 011010...0 and 011110...0 it returns 3.
    :param value1: First id
    :param value2: Second id
    :return: index(from 0 to 127) of largest differing bit.
    """
    distance = value1 ^ value2
    length = -1
    while (distance):
        distance >>= 1
        length += 1
    return max(0, length)