19.02.2013, 22:36
Btw, I had some problems with that 'randomString' function, I have used that exact one in the past, but I think it has generated some characters what cannot be handled by the MySQL charset I am using, but as usual I am probably doing something dumb. Therefore I made my own random string generation, and created a random charset for it.
And I just use a 'for' loop with 'strcat' and 'random' to generate the salt.
This is here for anyone else who encounters this problem, but again, it's probably just me.
pawn Код:
new randomCharset[62][] =
{
"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z",
"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z",
"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"
};
pawn Код:
for(new index; index <= sizeof(AddedSalt); ++index)
{
strcat(AddedSalt, randomCharset[random(sizeof(randomCharset))]);
}