Skip to content

Instantly share code, notes, and snippets.

@chajr
Created May 2, 2019 13:25
Show Gist options
  • Save chajr/e5d8cd3cf52c6d59311a3b682d451182 to your computer and use it in GitHub Desktop.
Save chajr/e5d8cd3cf52c6d59311a3b682d451182 to your computer and use it in GitHub Desktop.
#! /usr/local/opt/[email protected]/bin/php
<?php
$algList = hash_algos();
foreach ($algList as $alg) {
$time = microtime(true);
for ($i = 0; $i <= 10000; $i++) {
// $hash = hash_file($alg, 'composer.lock');
$hash = hash($alg, 'th thd ghdg h awf aw fgawrg aerg earg esrg esrg esr gse rgse reg serg se se rgse rs ');
}
$endTime = microtime(true);
$diff = $endTime - $time;
$hashLen = strlen($hash);
echo "$diff - $alg - $hashLen\n";
}
//./test | sort
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment