OILS / mycpp / hash.h View on Github | oilshell.org

19 lines, 13 significant
1#ifndef MYCPP_HASH_H
2#define MYCPP_HASH_H
3
4typedef unsigned (*HashFunc)(const char*, int);
5
6unsigned fnv1(const char* data, int len);
7
8template <typename L, typename R>
9class Tuple2;
10
11class BigStr;
12
13unsigned hash_key(BigStr* s);
14unsigned hash_key(int n);
15unsigned hash_key(Tuple2<int, int>* t1);
16unsigned hash_key(Tuple2<BigStr*, int>* t1);
17unsigned hash_key(void* p); // e.g. for Dict<Token*, int>
18
19#endif // MYCPP_HASH_H