09.04.2009, 18:24
hello,
i want to decode the result of udb_hash, because i use it to save passwords ina dudb.sav file and i need to know the password (because, if someone forget his password, i will get it by mail).
The code to encode it's:
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;
}
i want to decode the result of udb_hash, because i use it to save passwords ina dudb.sav file and i need to know the password (because, if someone forget his password, i will get it by mail).
The code to encode it's:
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;
}