SA-MP Forums Archive
Suggestion safety - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Suggestion safety (/showthread.php?tid=449271)



Suggestion safety - lexurs - 08.07.2013

My friend sent me a code and he said that I should put the following code in my script.

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 just want to know what it is, what it will do, and will this be safe for my server.


Re: Suggestion safety - Goldilox - 08.07.2013

It's a password hashing code. In the userfiles, it won't save the exact password user chosen, It'll hash in udb and save it.

#include <dudb>