20.03.2012, 11:32
Mash it, mashing it is the better way so no one can see the real pass.
example when you type 871425 in the database it will be 418474
to mash it you need this:
then do this
example when you type 871425 in the database it will be 418474
to mash it you need this:
pawn Код:
//credits to DracoBlue - taken from dudb
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;
}
pawn Код:
INI_WriteInt(Data, "Password", udb_hash(inputtext));