7 * Note: I could use mhash_count() here but I like to see unavailable hashers
8 * because this is important to me to choose the most-available hasher(s) and
9 * those with the best speed/secure tradeoff.
11 $hasher = hash_algos();
16 print 'Iterating ' . $count . 'x over all ' . count($hasher) . ' hash functions ...' . "\r\n";
18 foreach ($hasher as $hash) {
19 $time = microtime(true);
20 for ($idx = 0; $idx <= $count; $idx++) {
21 $dummy = hash($hash, 'hash-test-abc-123-foo-bar');
24 $timers[$hash] = (microtime(true) - $time);
31 print 'Result from hash() benchmark (in seconds per hasher):' . "\r\n";
32 print_r($timers) . "\n";