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