SA-MP Forums Archive
PHP hash whirlpool - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: PHP hash whirlpool (/showthread.php?tid=601100)



PHP hash whirlpool - EmiGjoni - 16.02.2016

Hi there
How to switch from SHA512 hash to whirlpool from code below


Код:
$SQLAddUser -> execute(array(':username' => $_POST['username'], ':password' => hash('SHA512', $_POST['password']), ':mbt' => intval($_POST['mbt']), ':expire' => strtotime("{$_POST['day']} {$_POST['month']} {$_POST['year']}")));
Problem is that i got this source from another thing and now i wanna switch it for samp but hash is in SHA512. Should i just remove SHA512 and write whirlpool instead?


Re: PHP hash whirlpool - Kyle - 16.02.2016

Yes, Change "SHA512" to "whirlpool".

http://php.net/manual/en/function.hash.php


Re: PHP hash whirlpool - Sithis - 16.02.2016

Additional hint: PHP's whirlpool implementation uses upper case letters where PAWN's implementation uses lowercase letters. When I used it, I had to use a toUpper function to get correctly matching passwords.