def xor_bytes ( a , b ) : assert len ( a ) == len ( b ) return bytes ( map ( operator . xor , a , b ) )
function that accepts two bitstrings and returns the xor value python
Calculate the byte wise exclusive of of two : class : bytes objects of the same length .
def xor_bytes(a, b):
    """
    Calculate the byte wise exclusive of of two :class:`bytes` objects
    of the same length.
    """
    assert len(a) == len(b)
    return bytes(map(operator.xor, a, b))