SpookyTest.cpp 505 B

1234567891011121314151617
  1. #include "Spooky.h"
  2. void SpookyHash32_test(const void *key, int len, uint32_t seed, void *out) {
  3. *(uint32_t*)out = SpookyHash::Hash32(key, len, seed);
  4. }
  5. void SpookyHash64_test(const void *key, int len, uint32_t seed, void *out) {
  6. *(uint64_t*)out = SpookyHash::Hash64(key, len, seed);
  7. }
  8. void SpookyHash128_test(const void *key, int len, uint32_t seed, void *out) {
  9. uint64_t h1 = seed, h2 = seed;
  10. SpookyHash::Hash128(key, len, &h1, &h2);
  11. ((uint64_t*)out)[0] = h1;
  12. ((uint64_t*)out)[1] = h2;
  13. }