@staticmethod
def _bitdiff(this_bytes, other_bytes):
    """ Calculates the percent of different bits between two byte
        strings.
        """
    if len(this_bytes) == 0 or len(other_bytes) == 0:
        return None
    masks = [1, 2, 4, 8, 16, 32, 64, 128]
    diffbits = 0
    totalbits = 0
    for this_byte, other_byte in zip(this_bytes, other_bytes):
        for mask in masks:
            this_masked = mask & this_byte
            other_masked = mask & other_byte
            diffbits += this_masked != other_masked
            totalbits += 1
    doubdiff = diffbits / totalbits
    return int(doubdiff * 100)
