Last active
December 15, 2017 18:59
-
-
Save cliffom/72860312af64e92fbed84e3d0755babf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/php | |
<?php | |
$iterations = $argv[1] ? $argv[1] : 1; | |
$file = "rand.txt"; | |
$dat = file_get_contents($file); | |
$dat = getHash($dat, $iterations); | |
echo $dat . "\n"; | |
function getHash($data, $iterations) { | |
for ($i=0; $i<$iterations-1; $i++) { | |
$data = hash("sha256", $data, true); | |
} | |
return hash("sha256", $data); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment