05.09.2010, 12:02
I'm making a PHP User Control Panel for my gamemode.
In my gm I use this function to hash passwords:
and in php to crypt strings I converted this function to:
But the two functions generate different results! Why? These functions seem to be equals...
Php strings are different than pawn strings?
In my gm I use this function to hash passwords:
Код:
stock num_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;
}
Код:
<?php
function num_hash($buf)
{
$length=strlen($buf);
$s1 = 1;
$s2 = 0;
$n = 0;
for ($n; $n<$length; $n++)
{
$s1 = ($s1 + $buf[$n]) % 65521;
$s2 = ($s2 + $s1) % 65521;
}
return ($s2 << 16) + $s1;
}
?>
Php strings are different than pawn strings?


