Whirlpool 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: Whirlpool HASH (
/showthread.php?tid=397725)
Whirlpool HASH -
Stefand - 06.12.2012
Hello I need some help, with the Hash function from Whirlpool
pawn Code:
case 3895:
{
new string[128];
format(string, sizeof(string), "Accounts/%s.ini", GetName(playerid));
if(response == 0)
{
Kick(playerid);
}
else
{
if(!fexist(string))
{
if(strlen(inputtext) >= 1)
{
new pw[128];
WP_Hash(pw, sizeof (pw), inputtext);
RegisterPlayer(playerid, pw);
}
else
{
SendClientMessage(playerid, WHITE, "Must be longer than 1 char.");
}
}
else
{
SendClientMessage(playerid, WHITE, "Your account already exists.");
}
}
}
Thats the dialogresponce from the register window.
then I got my Register function:
pawn Code:
public RegisterPlayer(playerid, password[])/*register*/
{
new string[128], Name[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, sizeof(Name));
format(string, sizeof(string), "Accounts/%s.ini", Name);
if(!fexist(string))
{
dini_Create(string);
dini_Set(string, "Password", password);
format(Player[playerid][Password], 128, "%s", password);
but the file shows:
What did I do wrong?
Re: Whirlpool HASH -
Lordzy - 06.12.2012
Set the string size which you're executing in Whirlpool to 129 because thats the size in which Whirlpool performs hashing.
Re: Whirlpool HASH -
Stefand - 06.12.2012
Quote:
Originally Posted by Lordz™
Set the string size which you're executing in Whirlpool to 129 because thats the size in which Whirlpool performs hashing.
|
Quote:
Originally Posted by Y_Less
Did you try debugging the "RegisterPlayer" function?
|
Just debugged it with the comment from Lordz, working now thanks
~SOLVED~