Anti-Spam(strcmp vs udb_Hash)
#3

Quote:

Edit:
I'm kicking only if the text repeats ~30 times, so the collisions don't really matter. Maybe this would do:
pawn Код:
stock small_hash(buf[])
{
    new int,len=strlen(buf);
    for(new i=0;i<len;i++) int+=buf[i];
    return int;
}
I tought about the same a few weeks ago, and the checks showed that strcmp is extremely powerful against this hash. (tested with 4,000,000 cells though :Đ)

Edit: if you'd use this hash, speedup:
pawn Код:
stock small_hash(buf[])
{
    new i = -1, int = 0;
    while (buf[++i] != 0) int += buf[i];
    return int;
}
as strlen loops through the whole string, which is already done by us.
Reply


Messages In This Thread
Anti-Spam(strcmp vs udb_Hash) - by wups - 17.09.2011, 14:36
Re: Anti-Spam(strcmp vs udb_Hash) - by JaTochNietDan - 17.09.2011, 16:29
Re: Anti-Spam(strcmp vs udb_Hash) - by KoczkaHUN - 03.10.2011, 17:44

Forum Jump:


Users browsing this thread: 2 Guest(s)