Greetings members of the programming technorati. I come seeking guidance on how to generate a sha3-512 hash by using the hash_algos method, since I noticed that it can generate hashes for many of the supported hash algorithms in php 7.xx. I wish to create a simple script using hash_algos to generate a hash with a salt. Here is the code:
<?php
$data = 453570 ;
$new_hash = hash_algos(sha-512);
$sha = hash($new_hash, $data);
echo $sha;
//this will generate hashes and lengths of the hashes
foreach (hash_algos() as $v) {
$r = hash($v, $data, false);
printf("%-12s %3d %s\n<br>", $v, strlen($r), $r);
}
?>
Thanks in advance,
Batoe