def _websocket_mask_python(mask, data):
 mask_arr = array.array('B', mask)
 unmasked_arr = array.array('B', data)
 for i in xrange(len(data)):
  unmasked_arr[i] = (unmasked_arr[i] ^ mask_arr[(i % 4)])
 if PY3:
  return unmasked_arr.tobytes()
 else:
  return unmasked_arr.tostring()

def _websocket_mask_python ( mask , data ) : mask_arr = array . array ( 'B' , mask ) unmasked_arr = array . array ( 'B' , data ) for i in xrange ( len ( data ) ) : unmasked_arr [ i ] = ( unmasked_arr [ i ] ^ mask_arr [ ( i % 4 ) ] ) if PY3 : return unmasked_arr . tobytes ( ) else : return unmasked_arr . tostring ( )
websocket masking function .