21.02.2012, 17:44
No. Depends on what you actually mean by "inefficient". This will be even more "efficient" for your server as the hash does get generated by my free hosted website. If you mean the time it takes to get the result, it won't even take more than half a second in most cases to get the value generated in your preferred algorithm.
No need for that. As I mentioned in the first post, you can use playerid as index in the second parameter of Hash.
Same as how you register the player (see example below).
I'm sorry, didn't quite understand that one.
Well, if you need MD5 and you're using MySQL, it's better to use the MD5 hash functionality of MySQL. For all other hashes (SHA, Whirlpool, ...) I still recommend this. You will probably agree after seeing the example.
I quickly created a register/login system using MySQL with Whirlpool hasing using my include.
http://pastebin.com/V1vsNBcZ
I just tested it and it works as expected without any problems nor delays. Here's the table (players.sql) if you'd like to test it either:
As you can see, my (Whirlpool) password "12345" is generated correctly into my table.
Quote:
The only possible way I see, is that you hash the given password, from let's say a dialog, using Hash(MD5, x,inputtext). And then, you assign a variable to the playerid, who just submitted the text.
Next, you want to loop through all the players online, to find out who exactly submitted the code, and after that, amend the hashed password to his file/file-on-database. |
Same as how you register the player (see example below).
I'm sorry, didn't quite understand that one.
Quote:
If so, wouldn't it be a lot easier to simply use the MD5 hasher that comes with MySQL. Or ******'s whirlpool plugin?
|
I quickly created a register/login system using MySQL with Whirlpool hasing using my include.
http://pastebin.com/V1vsNBcZ
I just tested it and it works as expected without any problems nor delays. Here's the table (players.sql) if you'd like to test it either:
pawn Код:
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
CREATE TABLE IF NOT EXISTS `players` (
`Name` varchar(24) NOT NULL,
`Password` varchar(129) NOT NULL,
`Score` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
INSERT INTO `players` (`Name`, `Password`, `Score`) VALUES
('RyDeR', 'cce08bba3f2e3c029cd257104b06d4b075772d5f514cf1b7789506f9a69d53c51464881d2c18445ab290553b302f67a24b1c69e3e737a46215deaf43517e4960', 999999);