num hash problem
#3

pawn Код:
stock num_hash(buf[])
{
    new length = strlen(buf),s1 = 1,s2 = 0,n;
    for(n = 0; n < length; n++)
    {
        s1 = (s1 + buf[n]) % 65521;
        s2 = (s2 + s1)     % 65521;
    }
    return (s2 << 16) + s1;
}
Reply


Messages In This Thread
num hash problem - by Shobi - 28.10.2013, 19:48
Re: num hash problem - by Brandon_More - 28.10.2013, 19:55
Re: num hash problem - by tyler12 - 28.10.2013, 20:01

Forum Jump:


Users browsing this thread: 2 Guest(s)