Initial import

git-svn-id: http://moon:8086/svn/software/trunk/libsrc/hash@1 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
2014-07-19 07:44:42 +00:00
commit d26aec2929
2 changed files with 134 additions and 0 deletions
Executable
+17
View File
@@ -0,0 +1,17 @@
// -------------------------------------------------------------------
// hash.h
// -------------------------------------------------------------------
#ifndef HASH_H
#define HASH_H
// -------------------------------------------------------------------
typedef unsigned long int ub4; /* unsigned 4-byte quantities */
typedef unsigned char ub1; /* unsigned 1-byte quantities */
#define hashsize(n) ((ub4)1<<(n))
#define hashmask(n) (hashsize(n)-1)
ub4 hash(ub1 *k, ub4 length, ub4 initval);
// -------------------------------------------------------------------
#endif // HASH_H