def hamming_distance(s1, s2):
    """Return the Hamming distance between equal-length sequences, a measure of hash similarity"""
    # Transform into a fixed-size binary string first
    s1bin = ' '.join('{0:08b}'.format(ord(x), 'b') for x in s1)
    s2bin = ' '.join('{0:08b}'.format(ord(x), 'b') for x in s2)
    if len(s1bin) != len(s2bin):
        raise ValueError("Undefined for sequences of unequal length")
    return sum(el1 != el2 for el1, el2 in zip(s1bin, s2bin))