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

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