Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

赞一个这个哈希函数,用于UNINX的ELF可执行文件

Posted by moorage at 2011-04-10 17:36:48 on Problem 2503
赞一个这个哈希函数,用于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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator