【文件属性】:
文件名称:字符串哈希成数字的C实现的代码(含测试)
文件大小:3KB
文件格式:ZIP
更新时间:2013-09-20 06:39:29
C 字符串 哈希代码
将字符串哈希成数字的几种经典的方法:其中的一部分
#ifndef INCLUDE_GENERALHASHFUNCTION_C_H
#define INCLUDE_GENERALHASHFUNCTION_C_H
#include
typedef unsigned int (*hash_function)(char*, unsigned int len);
unsigned int RSHash (char* str, unsigned int len);
unsigned int JSHash (char* str, unsigned int len);
unsigned int PJWHash (char* str, unsigned int len);
unsigned int ELFHash (char* str, unsigned int len);
unsigned int BKDRHash(char* str, unsigned int len);
unsigned int SDBMHash(char* str, unsigned int len);
unsigned int DJBHash (char* str, unsigned int len);
unsigned int DEKHash (char* str, unsigned int len);
unsigned int BPHash (char* str, unsigned int len);
unsigned int FNVHash (char* str, unsigned int len);
unsigned int APHash (char* str, unsigned int len);
#endif
【文件预览】:
GeneralHashFunctions_-_C
----GeneralHashFunctions.h(2KB)
----HashTest.c(2KB)
----Makefile(804B)
----GeneralHashFunctions.c(4KB)