rit_Hash(buffer[]);
case DIALOG_REGISTER: //From Kush's Tutorial
{
if (!response) return Kick(playerid);
if(response)
{
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"Registering...",""COL_RED"You have entered an invalid password.\n"COL_WHITE"Type your password below to register a new account.","Register","Quit");
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteString(File,"Password",rit_Hash(inputtext));
INI_WriteInt(File,"Cash",0);
INI_WriteInt(File,"Admin",0);
INI_WriteInt(File,"Kills",0);
INI_WriteInt(File,"Deaths",0);
INI_Close(File);
SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
SpawnPlayer(playerid);
ShowPlayerDialog(playerid, DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"Great! Your Y_INI system works perfectly. Relog to save your stats!","Ok","");
}
}
case DIALOG_LOGIN:
{
if ( !response ) return Kick ( playerid );
if( response )
{
if(!strcmp(rit_Hash(inputtext),PlayerInfo[playerid][pPass],false))
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"You have successfully logged in!","Ok","");
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_RED"You have entered an incorrect password.\n"COL_WHITE"Type your password below to login.","Login","Quit");
}
return 1;
}
}
Output : 861498793485876612876612793485808599
|
It looks effectively the same as udb_hash so I personally wouldn't use it as I doubt it's a secure as Whirlpool and even MD5 for that matter. But good work regardless!
|
|
77 lines of comments, 10 lines of code... Better release it as a function. |
|
It is only available for "pawno" scripting language. |

public static String rit_DeHash(String buffer)
{
int length = buffer.length();
String result = "";
String temp = "";
for(int i=0;i<length;i++)
{
temp = temp + buffer.charAt(i);
if(Integer.parseInt(temp) % 7557 == 0 && Integer.parseInt(temp)!= 0)
{
if(i < length-1 && buffer.charAt(i+1) == '0') continue;
result += Character.toString((char) (Integer.parseInt(temp)/7557));
//System.out.println(result);
temp = "";
}
}
return result;
}
I was trying to do it in the few minutes I had before work -.- But yea it's actually very similar to udb. Sorry about the formatting, just took the function from my GitHub repo
|
@wups DAMN! You beat me to it
I was trying to do it in the few minutes I had before work -.- But yea it's actually very similar to udb. Sorry about the formatting, just took the function from my GitHub repo![]() |
|
Cheers! Udb_hash is much more complicated than this. I have yet to see a working decoder for it, I tried to make such, no luck though
![]() |