title: Simple Python Challenge: Fastest Bitwise XOR on Data Buffers
body: <p><strong>Challenge:</strong></p>
  
  <p>Perform a bitwise XOR on two equal sized buffers. The buffers will be required to be the python <code>str</code> type since this is traditionally the type for data buffers in python. Return the resultant value as a <code>str</code>. Do this as fast as possible.</p>
  
  <p>The inputs are two 1 megabyte (2**20 byte) strings.</p>
  
  <p>The challenge is to <strong>substantially</strong> beat my inefficient algorithm using python or existing third party python modules (relaxed rules: or create your own module.) Marginal increases are useless.</p>
  
  <pre><code>from os import urandom
  from numpy import frombuffer,bitwise_xor,byte
  
  def slow_xor(aa,bb):
      a=frombuffer(aa,dtype=byte)
      b=frombuffer(bb,dtype=byte)
      c=bitwise_xor(a,b)
      r=c.tostring()
      return r
  
  aa=urandom(2**20)
  bb=urandom(2**20)
  
  def test_it():
      for x in xrange(1000):
          slow_xor(aa,bb)
  </code></pre>