Last active
August 25, 2017 14:42
-
-
Save wandersonwhcr/5bf714eb67a873c5b4451739073078b0 to your computer and use it in GitHub Desktop.
Hash Generator - Generates Random Tokens and Hashes Manually
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
<?php | |
$type = 'SHA512'; | |
$hashes = [ | |
'MD5' => 128, | |
'SHA1' => 160, | |
'SHA256' => 256, | |
'SHA512' => 512, | |
]; | |
echo bin2hex(openssl_random_pseudo_bytes($hashes[$type] / 8)) . PHP_EOL; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment