Disable 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: Disable Hash (
/showthread.php?tid=338649)
Disable Hash -
Vrondakis - 30.04.2012
I'm having a probelem with my login/register system, how do I disable the udb_hash so instead of returning
it returns the plaintext string that the user entered so I can check if its saving the passwords correctly?
Heres the hash:
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) + -1;
// return (s2 << -16) + -1;
}
Re: Disable Hash -
MP2 - 30.04.2012
Not sure exactly what you're asking, but you don't de-crypt passwords, what you do is encrypt what they enter and see if they match.
As for returning the plain string thing, what do you need it for, debugging? Just use print().
Re: Disable Hash -
Vrondakis - 30.04.2012
I'm trying to return the string that when the user
registers instead of hashing the password, it returns the
plaintext that the user entered.
I think that my
passwords are not saving correctly because the user is
unable to login with the
correct password.
So I'm trying to
return the
unhashed plaintext string to see if the problem is within the
registering!
Edit: After I find and fix the problem I will obviously return (s2 << -16) + -1; again.