Created
March 31, 2016 15:22
-
-
Save dededey/92041a05694f54c764fb76a5902a15b8 to your computer and use it in GitHub Desktop.
password salt generator and has
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
$salt = uniqid(mt_rand(), true); | |
function getSaltedHash($password, $salt) { | |
$hash = $password . $salt; | |
for ($i = 0; $i < 50; $i++) { | |
$hash = hash('sha512', $password . $hash . $salt); | |
} | |
return $hash; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment