29.08.2014, 05:22
If anyone is decent with PHP, how would I convert this stock into PHP?
I'm using it for a simple online user account system, I am not concerned with security, I would just like to know how to do it.
I'm using it for a simple online user account system, I am not concerned with security, I would just like to know how to do it.
pawn Код:
stock num_hash(buf[])//Dutils.inc
{
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;
}