(mask_key, data)
return _d.tostring()
mask or unmask data. Just do xor for each byte

        mask_key: 4 byte string(byte).

        data: data to mask/unmask.
mask or unmask data. Just do xor for each byte
mask or unmask data . Just do xor for each byte
def mask(mask_key, data):
        """
        mask or unmask data. Just do xor for each byte

        mask_key: 4 byte string(byte).

        data: data to mask/unmask.
        """
        _m = array.array("B", mask_key)
        _d = array.array("B", data)
        for i in xrange(len(_d)):
            _d[i] ^= _m[i % 4]
        return _d.tostring()
def mask ( mask_key , data ) : _m = array . array ( "B" , mask_key ) _d = array . array ( "B" , data ) for i in xrange ( len ( _d ) ) : _d [ i ] ^= _m [ i % 4 ] return _d . tostring ( )