MurmurHash2.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. //-----------------------------------------------------------------------------
  2. // MurmurHash2 was written by Austin Appleby, and is placed in the public
  3. // domain. The author hereby disclaims copyright to this source code.
  4. #ifndef _MURMURHASH2_H_
  5. #define _MURMURHASH2_H_
  6. #include <stddef.h>
  7. //-----------------------------------------------------------------------------
  8. // Platform-specific functions and macros
  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. #ifdef __cplusplus
  20. extern "C" {
  21. #endif
  22. uint32_t MurmurHash2 ( const void * key, size_t len, uint32_t seed );
  23. uint64_t MurmurHash64A ( const void * key, size_t len, uint64_t seed );
  24. uint64_t MurmurHash64B ( const void * key, size_t len, uint64_t seed );
  25. uint32_t MurmurHash2A ( const void * key, size_t len, uint32_t seed );
  26. uint32_t MurmurHashNeutral2 ( const void * key, size_t len, uint32_t seed );
  27. uint32_t MurmurHashAligned2 ( const void * key, size_t len, uint32_t seed );
  28. #ifdef __cplusplus
  29. }
  30. #endif
  31. //-----------------------------------------------------------------------------
  32. #endif // _MURMURHASH2_H_