I made a page that shows the hash in several hash_algos in order to study their differences, however I would like to sort by the size of the hash and not by the name of the hash_algos, the code is this,
<?php foreach (hash_algos() as $hash_algos) {
$hash = hash($hash_algos, "salt", false); ?>
<li>
<span><?php echo $hash_algos; ?></span>
<span><?php echo strlen($hash); ?></span>
<span><?php echo $hash; ?></span>
</li>
<?php } ?>
would like to be printed, be ordered by the size of the hash that in the case depending on the algos it will take from 8 to 128 and make a sub sort with the algos, ie put all of 8 with all fnv, the second sort is not so important, I just wanted to see how to sort the size.
example in ideone
Thank you in advance