farmhash-c-test.cc 644 B

1234567891011121314151617
  1. #include "farmhash-c.h"
  2. #include <stdint.h>
  3. #include <string.h>
  4. void farmhash32_c_test ( const void * key, int len, uint32_t seed, void * out ) {
  5. *(uint32_t*)out = farmhash32_with_seed((const char *)key,(size_t)len,seed);
  6. }
  7. void farmhash64_c_test ( const void * key, int len, uint32_t seed, void * out ) {
  8. *(uint64_t*)out = farmhash64_with_seed((const char *)key,(size_t)len,(uint64_t)seed);
  9. }
  10. void farmhash128_c_test ( const void * key, int len, uint32_t seed, void * out ) {
  11. uint128_c_t s = make_uint128_c_t(seed, 0UL);
  12. uint128_c_t result = farmhash128_with_seed((const char *)key, (size_t)len, s);
  13. memcpy(out, &result, 128/8);
  14. }