9
we use md5 as a hashing algorithm in many parts of our code.
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.
collisions are an issue. although unlikely, it would cause some major issues.
anyone want to suggest something lighter on the cpu?
thanks.
we have just done some testing with md5 vs crc32.
using the following snippet:
<?
$start=microtime(true);
for($i=1;$i<=1000000;$i++){
md5(rand(10000000,99999999)); <--- crc32 tested here too.
}
$end=microtime(true);
echo $end-$start."\n";
?>
there results are as follow:
md5:
1.4991459846497
1.7893800735474
1.4672470092773
crc32:
0.97880411148071
0.94331979751587
0.93316197395325
so it would appear crc32 is about 1/3 faster then using md5.