MCPcopy Create free account
hub / github.com/apache/impala / FnvHash

Function FnvHash

be/src/udf_samples/hyperloglog-uda.cc:57–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55static const uint64_t FNV64_SEED = 14695981039346656037UL;
56
57static uint64_t FnvHash(const void* data, int32_t bytes, uint64_t hash) {
58 const uint8_t* ptr = reinterpret_cast<const uint8_t*>(data);
59 while (bytes--) {
60 hash = (*ptr ^ hash) * FNV64_PRIME;
61 ++ptr;
62 }
63 return hash;
64}
65
66static uint64_t Hash(const IntVal& v) {
67 return FnvHash(&v.val, sizeof(int32_t), FNV64_SEED);

Callers 1

HashFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected