static inline uint64_t Hash128to64(const local_uint128& x) { // Murmur-inspired hashing. const uint64_t kMul = 0x9ddfea08eb382d69ULL; uint64_t a = (Uint128Low64(x) ^ Uint128High64(x)) * kMul; a ^= (a >> 47); uint64_t b = (Uint128High64(x) ^ a) * kMul; b ^= (b >> 47); b *= kMul; return b; }
void cch_cityhash128 (cch_uint128_t * result, const char *s, size_t len) { #ifdef HAVE_CITYHASH128 uint128 rv; rv = CityHash128(s, len); result->low = Uint128Low64(rv); result->high = Uint128High64(rv); #else feature_failure(__func__); #endif }
void cch_cityhash128_with_seed (cch_uint128_t * result, const char *s, size_t len, cch_uint128_t * seme) { #ifdef HAVE_CITYHASH128WITHSEED uint128 rv; uint128 seed(seme->low, seme->high); rv = CityHash128WithSeed(s, len, seed); result->low = Uint128Low64(rv); result->high = Uint128High64(rv); #else feature_failure(__func__); #endif }