¸½£º¸÷ÖÖ¹þÏ£º¯ÊýµÄCÓïÑÔ³ÌÐò´úÂë{unsignedinthash=0;while(*str){//equivalentto:hash=65599*hash+(*str++);hash=(*str++)+(hash6)+(hash16)-hash;}return(hash&0x7FFFFFFF);}//RSHashunsignedintRSHash(char*str){unsignedintb=378551;unsignedinta=63689;unsignedinthash=0;while(*str){hash=hash*a+(*str++);a*=b;}return(hash&0x7FFFFFFF);}//JSHashunsignedintJSHash(char*str){unsignedinthash=1315423911;while(*str){hash^=((hash5)+(*str++)+(hash2));}return(hash&0x7FFFFFFF);}//P.J.WeinbergerHashunsignedintPJWHash(char*str){unsignedintBitsInUnignedInt=(unsignedint)(sizeof(unsignedint)*8);unsignedintThreeQuarters=(unsignedint)((BitsInUnignedInt*3)/4);unsignedintOneEighth=(unsignedint)(BitsInUnignedInt/8);unsignedintHighBits=(unsignedint)(0xFFFFFFFF)(BitsInUnignedIntunsignedintSDBMHash(char*str)-OneEighth);unsignedinthash=0;unsignedinttest=0;while(*str){hash=(hashOneEighth)+(*str++);if((test=hash&HighBits)!=0){hash=((hash^(testThreeQuarters))&(~HighBits));}}return(hash&0x7FFFFFFF);}//ELFHashunsignedintELFHash(char*str){unsignedinthash=0;unsignedintx=0;while(*str){hash=(hash4)+(*str++);if((x=hash&0xF0000000L)!=0){hash^=(x24);hash&=~x;}}return(hash&0x7FFFFFFF);}//BKDRHashunsignedintBKDRHash(char*str){unsignedintseed=131;//31131131313131131313etc..unsignedinthash=0;while(*str){hash=hash*seed+(*str++);}return(hash&0x7FFFFFFF);}//DJBHashunsignedintDJBHash(char*str){unsignedinthash=5381;while(*str){hash+=(hash5)+(*str++);}return(hash&0x7FFFFFFF);}//APHashunsignedintAPHash(char*str){unsignedinthash=0;inti;for(i=0;*str;i++){if((i&1)==0){hash^=((hash7)^(*str++)^(hash3));}else{hash^=(~((hash11)^(*str++)^(hash5)));}}return(hash&0x7FFFFFFF);}