Ruby password SHA512 hash replication using PHP
is there any way I can reproduce this ruby function:
def Password.hash(password,salt)
Digest::SHA512.hexdigest("#{password}:#{salt}"开发者_StackOverflow)
end
In php.
Cheers
Something like this should do it, using the php hash() function
function passwordhash($password, $salt)
{
return hash('sha512', "{$password}:{$salt}");
}
精彩评论