SA-MP Forums Archive
Password Hash - 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: Password Hash (/showthread.php?tid=330554)



Password Hash - BleverCastard - 01.04.2012

Hello,
I'm making a user CP for my server,
Does anyone know what Vx-RP 2 password's are hashed by?

Thanks.


Re: Password Hash - ReneG - 01.04.2012

Passwords are hashed using Whirlpool. You could have found that in the gamemode release thread.


Re: Password Hash - HuSs3n - 01.04.2012

/*Credits to Dracoblue*/
pawn Код:
stock udb_hash(buf[]) {
    new length=strlen(buf);
    new s1 = 1;
    new s2 = 0;
    new n;
    for (n=0; n<length; n++)
    {
       s1 = (s1 + buf[n]) % 65521;
       s2 = (s2 + s1)     % 65521;
    }
    return (s2 << 16) + s1;
}