summaryrefslogtreecommitdiff
path: root/lookupa.h
blob: ffb57384d2a4fc409d9b16f69e8959273b799a8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*
------------------------------------------------------------------------------
By Bob Jenkins, September 1996.
lookupa.h, a hash function for table lookup, same function as lookup.c.
Use this code in any way you wish.  Public Domain.  It has no warranty.
Source is http://burtleburtle.net/bob/c/lookupa.h
------------------------------------------------------------------------------
*/

#ifndef LOOKUPA
#define LOOKUPA

#include "mpqlib-stdint.h"

#define CHECKSTATE 8
#define hashsize(n) ((uint32_t)1<<(n))
#define hashmask(n) (hashsize(n)-1)

#ifdef __cplusplus
extern "C" {
#endif

uint32_t lookup(uint8_t * k, uint32_t length, uint32_t level);
void checksum(uint8_t * k, uint32_t length, uint32_t * state);

#ifdef __cplusplus
}
#endif

#endif /* LOOKUPA */