-
Notifications
You must be signed in to change notification settings - Fork 1
/
Hashes.h
78 lines (58 loc) · 3 KB
/
Hashes.h
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#pragma once
#include "Types.h"
#include "MurmurHash1.h"
#include "MurmurHash2.h"
#include "MurmurHash3.h"
//----------
// These are _not_ hash functions (even though people tend to use crc32 as one...)
void sumhash ( const void * key, int len, uint32_t seed, void * out );
void sumhash32 ( const void * key, int len, uint32_t seed, void * out );
void DoNothingHash ( const void * key, int len, uint32_t seed, void * out );
void crc32 ( const void * key, int len, uint32_t seed, void * out );
void randhash_32 ( const void * key, int len, uint32_t seed, void * out );
void randhash_64 ( const void * key, int len, uint32_t seed, void * out );
void randhash_128 ( const void * key, int len, uint32_t seed, void * out );
//----------
// Cryptographic hashes
void md5_32 ( const void * key, int len, uint32_t seed, void * out );
void sha1_32a ( const void * key, int len, uint32_t seed, void * out );
//----------
// General purpose hashes
void FNV ( const void * key, int len, uint32_t seed, void * out );
void Bernstein ( const void * key, int len, uint32_t seed, void * out );
void SuperFastHash ( const void * key, int len, uint32_t seed, void * out );
void lookup3_test ( const void * key, int len, uint32_t seed, void * out );
void MurmurOAAT_test ( const void * key, int len, uint32_t seed, void * out );
void Crap8_test ( const void * key, int len, uint32_t seed, void * out );
void CityHash128_test ( const void * key, int len, uint32_t seed, void * out );
void CityHash64_test ( const void * key, int len, uint32_t seed, void * out );
void SpookyHash32_test ( const void * key, int len, uint32_t seed, void * out );
void SpookyHash64_test ( const void * key, int len, uint32_t seed, void * out );
void SpookyHash128_test ( const void * key, int len, uint32_t seed, void * out );
uint32_t MurmurOAAT ( const void * key, int len, uint32_t seed );
//----------
// MurmurHash2
void MurmurHash2_test ( const void * key, int len, uint32_t seed, void * out );
void MurmurHash2A_test ( const void * key, int len, uint32_t seed, void * out );
//-----------------------------------------------------------------------------
// Test harnesses for Murmur1/2
inline void MurmurHash1_test ( const void * key, int len, uint32_t seed, void * out )
{
*(uint32_t*)out = MurmurHash1(key,len,seed);
}
inline void MurmurHash2_test ( const void * key, int len, uint32_t seed, void * out )
{
*(uint32_t*)out = MurmurHash2(key,len,seed);
}
inline void MurmurHash2A_test ( const void * key, int len, uint32_t seed, void * out )
{
*(uint32_t*)out = MurmurHash2A(key,len,seed);
}
inline void MurmurHash64A_test ( const void * key, int len, uint32_t seed, void * out )
{
*(uint64_t*)out = MurmurHash64A(key,len,seed);
}
inline void MurmurHash64B_test ( const void * key, int len, uint32_t seed, void * out )
{
*(uint64_t*)out = MurmurHash64B(key,len,seed);
}