PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
lookupa.h
1/*
2------------------------------------------------------------------------------
3By Bob Jenkins, September 1996.
4lookupa.h, a hash function for table lookup, same function as lookup.c.
5Use this code in any way you wish. Public Domain. It has no warranty.
6Source is http://burtleburtle.net/bob/c/lookupa.h
7------------------------------------------------------------------------------
8*/
9
10#ifndef LOOKUPA_H
11#define LOOKUPA_H
12
13#include "standard.h"
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
19#define CHECKSTATE 8
20#define hashsize(n) ((size_t)1<<(n))
21#define hashmask(n) (hashsize(n)-1)
22
23extern uint32_t lookup(const char *k, size_t length, uint32_t level);
24extern void checksum(const char *k, size_t length, uint32_t *state);
25
26#ifdef __cplusplus
27}
28#endif
29
30#endif /* LOOKUPA */