#include <stdio.h>
unsigned int BKDRHash(char* str){//字符串hash
unsigned int seed = 131;// 31 131 1313 13131 131313 etc..
unsigned int hash = 0;
while (*str){
hash = hash * seed + (*str++);
}
return hash&0x7fffffff;
}
int main(){
unsigned int res = BKDRHash("abcdef");
printf("%d\n",res);
return 0;
}#include <stdio.h>
unsigned int BKDRHash(char