[HELP]Hasher
#1

pawn Код:
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;
}
Please, can anyone explain how the above code works?
Like why we have defined many variables, what are we returning, etc.
Reply


Messages In This Thread
[HELP]Hasher - by nilanjay - 02.08.2014, 09:53
Re: [HELP]Hasher - by GeekSiMo - 02.08.2014, 09:59
Re: [HELP]Hasher - by nilanjay - 02.08.2014, 10:02
Re: [HELP]Hasher - by GeekSiMo - 02.08.2014, 10:10

Forum Jump:


Users browsing this thread: 1 Guest(s)