| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
赞一个这个哈希函数,用于UNINX的ELF可执行文件赞一个这个哈希函数,用于UNINX的ELF可执行文件:
此乃必备字符串哈希函数啊!
int ELFhash(char * key)
{
unsigned int h = 0;
while (*key){
h = (h << 4) + *key++;
unsigned int g = h & 0xf0000000L;
if (g) h ^= g >> 24;
h &= ~g;
}
return h % prime;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator