title: what is the highest performance hashing algo available in php when security is NOT at stake?
body: <p>we use md5 as a hashing algorithm in many parts of our code.</p>
  
  <p>security in this context is NOT an issue. we just use md5 as a method of generating a unique identifier to store various items in apc etc.</p>
  
  <p>collisions are an issue. although unlikely, it would cause some major issues.</p>
  
  <p>anyone want to suggest something lighter on the cpu?</p>
  
  <p>thanks.</p>
  
  <hr>
  
  <p>we have just done some testing with md5 vs crc32.</p>
  
  <p>using the following snippet:</p>
  
  <pre><code>&lt;?
  $start=microtime(true);
  for($i=1;$i&lt;=1000000;$i++){
      md5(rand(10000000,99999999)); &lt;--- crc32 tested here too.
  }
  $end=microtime(true);
  echo $end-$start."\n";
  ?&gt;
  </code></pre>
  
  <p>there results are as follow:</p>
  
  <p><strong>md5:</strong></p>
  
  <pre><code>1.4991459846497
  1.7893800735474
  1.4672470092773
  </code></pre>
  
  <p><strong>crc32:</strong></p>
  
  <pre><code>0.97880411148071
  0.94331979751587
  0.93316197395325
  </code></pre>
  
  <p>so it would appear crc32 is about 1/3 faster then using md5.</p>