views:

448

answers:

1

Hi there, is there any way I can reproduce this ruby function:

def Password.hash(password,salt)
    Digest::SHA512.hexdigest("#{password}:#{salt}")
end

In php.

Cheers

+1  A: 

Something like this should do it, using the php hash() function

function passwordhash($password, $salt)
{
   return hash('sha512', "{$password}:{$salt}");
}
Paul Dixon
Cheers PaulThats worked a treat, nice one.
Simon