skipfish hash 算法

skipfish用到的hash函数
函数体为:

Static inline u32 hash_word(u8* str){
Register u32 ret = 0;
Register u8 cur;

If(str)
While((cur = *str)){
Ret = ~ret ^(cur) ^
(cur <>5)^
(cur < (cur< (cur<<30);
Str++;
}
Return ret % WORD_HASH;
}

#define WORD_HASH 256

2 Replies to “skipfish hash 算法”

发表评论

您的电子邮箱地址不会被公开。