hash.h 675 B

12345678910111213141516171819202122232425
  1. // Copyright 2015 Citra Emulator Project
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include "common/common_types.h"
  6. namespace Common {
  7. void MurmurHash3_128(const void* key, int len, u32 seed, void* out);
  8. /**
  9. * Computes a 64-bit hash over the specified block of data
  10. * @param data Block of data to compute hash over
  11. * @param len Length of data (in bytes) to compute hash over
  12. * @returns 64-bit hash value that was computed over the data block
  13. */
  14. static inline u64 ComputeHash64(const void* data, int len) {
  15. u64 res[2];
  16. MurmurHash3_128(data, len, 0, res);
  17. return res[0];
  18. }
  19. } // namespace Common