PMurHash128.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. // Microsoft Visual Studio
  10. #if defined(_MSC_VER) && (_MSC_VER < 1600)
  11. typedef unsigned char uint8_t;
  12. typedef unsigned int uint32_t;
  13. typedef unsigned __int64 uint64_t;
  14. // Other compilers
  15. #else // defined(_MSC_VER)
  16. #include <stdint.h>
  17. #endif // !defined(_MSC_VER)
  18. /* ------------------------------------------------------------------------- */
  19. /* Formal prototypes */
  20. // PMurHash128x64
  21. void PMurHash128x64_Process(uint64_t ph[2], uint64_t pcarry[2], const void *key, int len);
  22. void PMurHash128x64_Result(const uint64_t ph[2], const uint64_t pcarry[2], uint32_t total_length, uint64_t out[2]);
  23. void PMurHash128x64(const void * key, const int len, uint32_t seed, void * out);
  24. // PMurHash128x86
  25. void PMurHash128x86_Process(uint32_t ph[4], uint32_t pcarry[4], const void *key, int len);
  26. void PMurHash128x86_Result(const uint32_t ph[4], const uint32_t pcarry[4], uint32_t total_length, uint32_t out[4]);
  27. void PMurHash128x86(const void * key, const int len, uint32_t seed, void * out);