note 76881 deleted from function.hash by nlopess
| From: | nlopess@php.net | Date: | Wed, 08 Aug 2007 15:22:03 +0000 |
| Subject: | note 76881 deleted from function.hash by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-129318@lists.php.net to get a copy of this message | ||
Note Submitter: mysteryboy
----
<?php
/*PHP Version 5.2.3*/
echo 'hash<br />';
$time=microtime(1);
for ($i=0;$i<500000;$i++)
hash('md4', 'string');
echo microtime(1)-$time,': md4<br / >';
$time=microtime(1);
for ($i=0;$i<500000;$i++)
hash('md5', 'string');
echo microtime(1)-$time,': md5<br / >';
$time=microtime(1);
for ($i=0;$i<500000;$i++)
hash('adler32', 'string');
echo microtime(1)-$time,': adler32<br / >';
$time=microtime(1);
for ($i=0;$i<500000;$i++)
hash('crc32', 'string');
echo microtime(1)-$time,': crc32<br / >';
$time=microtime(1);
for ($i=0;$i<500000;$i++)
hash('crc32b', 'string');
echo microtime(1)-$time,': crc32b<br / >';
$time=microtime(1);
for ($i=0;$i<500000;$i++)
hash('sha1', 'string');
echo microtime(1)-$time,': sha1<br / >';
echo 'md5(),sha1()><br />';
$time=microtime(1);
for ($i=0;$i<500000;$i++)
md5('string');
echo microtime(1)-$time,': md5<br>';
$time=microtime(1);
for ($i=0;$i<500000;$i++)
sha1('string');
echo microtime(1)-$time,': sha1<br>';
?>
hash
1.1421868801117: md4
1.2192211151123: md5
1.0528500080109: adler32
0.89074683189392: crc32
0.92654180526733: crc32b
1.3730161190033: sha1
=========>>
0.83056497573853: md5
1.0000810623169: sha1