Whirlpool not hashing
#6

Quote:
Originally Posted by Avi57
Посмотреть сообщение
Add this code below your previous stock function.
Код:
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;
}
Get out.


Look at the size of your query. It's 200. Now look at the query below.
Код:
INSERT INTO PlayerData (Name, Password, Ip, PlayerLevel,Score,OFWarns) VALUES('%s', '%s','%s',0, 0, 0)
That query alone is 102 characters, a whirlpool password will always be 128, so now it's 230 characters. You're inputting a name too, so now it's 254, add that along with other variables you're inputting and you can see your query isn't long enough. Use common sense, use a string counter, print your queries next time.

pawn Код:
stock MySQL_Register(playerid, passwordstring[])
{
    new query[300], pname[24], IP[16];
    GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
    GetPlayerIp(playerid, IP, 16);

    format(query, sizeof(query), "INSERT INTO PlayerData (Name, Password, Ip, PlayerLevel,Score,OFWarns) VALUES('%s', '%s','%s',0, 0, 0)", pname, passwordstring, IP);
    mysql_query(query);
    SendClientMessage(playerid, -1, "You have been registered on this server!");
    return 1;
}
Reply


Messages In This Thread
Whirlpool not hashing - by SomebodyAndMe - 10.07.2012, 07:34
Re: Whirlpool not hashing - by SomebodyAndMe - 10.07.2012, 08:55
Re: Whirlpool not hashing - by SomebodyAndMe - 10.07.2012, 10:53
Re: Whirlpool not hashing - by Avi57 - 10.07.2012, 11:02
Re: Whirlpool not hashing - by Hiddos - 10.07.2012, 11:04
Re: Whirlpool not hashing - by ReneG - 10.07.2012, 11:09
Re: Whirlpool not hashing - by pyrodave - 10.07.2012, 11:14
Re: Whirlpool not hashing - by SomebodyAndMe - 10.07.2012, 11:17

Forum Jump:


Users browsing this thread: 1 Guest(s)