turbonss/src/jenkins_hash.h

21 lines
642 B
C
Raw Normal View History

2004-12-23 15:16:30 +02:00
#ifndef __JEKINS_HASH_H__
#define __JEKINS_HASH_H__
#include "hash.h"
2005-01-18 23:06:08 +02:00
typedef struct cmph__jenkins_state_t
2004-12-23 15:16:30 +02:00
{
CMPH_HASH hashfunc;
2005-01-18 23:06:08 +02:00
cmph_uint32 seed;
cmph_uint32 nbits;
cmph_uint32 size;
} cmph_jenkins_state_t;
2004-12-23 15:16:30 +02:00
2005-01-18 23:06:08 +02:00
cmph_jenkins_state_t *cmph_jenkins_state_new(cmph_uint32 size); //size of hash table
cmph_uint32 cmph_jenkins_hash(cmph_jenkins_state_t *state, const char *k, cmph_uint32 keylen);
void cmph_jenkins_state_dump(cmph_jenkins_state_t *state, char **buf, cmph_uint32 *buflen);
cmph_jenkins_state_t *cmph_jenkins_state_load(const char *buf, cmph_uint32 buflen);
void cmph_jenkins_state_destroy(cmph_jenkins_state_t *state);
2004-12-23 15:16:30 +02:00
#endif