MCPcopy Create free account
hub / github.com/apache/trafficserver / hash_fnv32

Function hash_fnv32

example/plugins/c-api/query_remap/query_remap.cc:174–185  ·  view source on GitHub ↗

FNV (Fowler/Noll/Vo) hash (description: http://www.isthe.com/chongo/tech/comp/fnv/index.html) */

Source from the content-addressed store, hash-verified

172/* FNV (Fowler/Noll/Vo) hash
173 (description: http://www.isthe.com/chongo/tech/comp/fnv/index.html) */
174uint32_t
175hash_fnv32(char *buf, size_t len)
176{
177 uint32_t hval = static_cast<uint32_t>(0x811c9dc5); /* FNV1_32_INIT */
178
179 for (; len > 0; --len) {
180 hval *= static_cast<uint32_t>(0x01000193); /* FNV_32_PRIME */
181 hval ^= static_cast<uint32_t>(*buf++);
182 }
183
184 return hval;
185}

Callers 1

TSRemapDoRemapFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected