def mask(self, data):
        """
        Performs the masking or unmasking operation on data
        using the simple masking algorithm:

        ..
           j                   = i MOD 4
           transformed-octet-i = original-octet-i XOR masking-key-octet-j

        """
        masked = bytearray(data)
        if py3k: key = self.masking_key
        else: key = map(ord, self.masking_key)
        for i in range(len(data)):
            masked[i] = masked[i] ^ key[4%i]
        return masked
dataset/ETHPy150Open Lawouach/WebSocket-for-Python/ws4py/framing.py/Frame.mask/swapped operands of `%`