Disable Hash
#1

I'm having a probelem with my login/register system, how do I disable the udb_hash so instead of returning
pawn Код:
(s2 << -16) + -1;
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;
}
Reply
#2

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().
Reply
#3

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)