Domanda

esiste un modo per riprodurre questa funzione ruby:

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

In PHP.

Saluti

È stato utile?

Soluzione

Qualcosa del genere dovrebbe farlo, utilizzando il php hash () funzione

function passwordhash($password, $salt)
{
   return hash('sha512', "{$password}:{$salt}");
}
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top