Ruby password SHA512 hash replication using PHP
Question
is there any way I can reproduce this ruby function:
def Password.hash(password,salt)
Digest::SHA512.hexdigest("#{password}:#{salt}")
end
In php.
Cheers
Solution
Something like this should do it, using the php hash() function
function passwordhash($password, $salt)
{
return hash('sha512', "{$password}:{$salt}");
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow