xref: /php-src/ext/hash/murmur/PMurHash128.h (revision 72e91e9f)
1 /*-----------------------------------------------------------------------------
2  * MurmurHash3 was written by Austin Appleby, and is placed in the public
3  * domain.
4  *
5  * This is a c++ implementation of MurmurHash3_128 with support for progressive
6  * processing based on PMurHash implementation written by Shane Day.
7  */
8 
9 /* ------------------------------------------------------------------------- */
10 
11 // Microsoft Visual Studio
12 
13 #if defined(_MSC_VER) && (_MSC_VER < 1600)
14 
15 typedef unsigned char uint8_t;
16 typedef unsigned int uint32_t;
17 typedef unsigned __int64 uint64_t;
18 
19 // Other compilers
20 
21 #else // defined(_MSC_VER)
22 
23 #include <stdint.h>
24 
25 #endif // !defined(_MSC_VER)
26 
27 /* ------------------------------------------------------------------------- */
28 /* Formal prototypes */
29 
30 // PMurHash128x64
31 void PMurHash128x64_Process(uint64_t ph[2], uint64_t pcarry[2], const void *key, int len);
32 void PMurHash128x64_Result(const uint64_t ph[2], const uint64_t pcarry[2], uint32_t total_length, uint64_t out[2]);
33 void PMurHash128x64(const void * key, const int len, uint32_t seed, void * out);
34 
35 // PMurHash128x86
36 void PMurHash128x86_Process(uint32_t ph[4], uint32_t pcarry[4], const void *key, int len);
37 void PMurHash128x86_Result(const uint32_t ph[4], const uint32_t pcarry[4], uint32_t total_length, uint32_t out[4]);
38 void PMurHash128x86(const void * key, const int len, uint32_t seed, void * out);
39 
40