CityTest.cpp 769 B

123456789101112131415161718192021222324252627282930313233
  1. #include "City.h"
  2. #include "CityCrc.h"
  3. void CityHash32_test ( const void * key, int len, uint32_t seed, void * out )
  4. {
  5. *(uint32*)out = CityHash32WithSeed((const char *)key,len,seed);
  6. }
  7. void CityHash64_test ( const void * key, int len, uint32_t seed, void * out )
  8. {
  9. *(uint64*)out = CityHash64WithSeed((const char *)key,len,seed);
  10. }
  11. #if defined(__SSE4_2__) && defined(__x86_64__)
  12. void CityHash128_test ( const void * key, int len, uint32_t seed, void * out )
  13. {
  14. uint128 s(0,0);
  15. s.first = seed;
  16. *(uint128*)out = CityHash128WithSeed((const char*)key,len,s);
  17. }
  18. void CityHashCrc128_test ( const void * key, int len, uint32_t seed, void * out )
  19. {
  20. uint128 s(0,0);
  21. s.first = seed;
  22. *(uint128*)out = CityHashCrc128WithSeed((const char*)key,len,s);
  23. }
  24. #endif