def hamming_distance(string1, string2):
    """
    string1 and string2 must be in bytes string.

    Return number of '1' in xor(string1, string2), it tell's how many bit
    are differents.
    """
    if len(string1) != len(string2):
        raise ValueError("Undefined for sequences of unequal length")

    return sum([bin(b1 ^ b2).count('1') for b1, b2 in zip(string1, string2)])