MCPcopy Create free account
hub / github.com/BYVoid/OpenCC / FNVHash

Function FNVHash

src/UTF8StringSlice.hpp:28–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26namespace internal {
27
28inline size_t FNVHash(const char* text, const size_t byteLength,
29 const size_t FNV_prime, const size_t FNV_offset_basis) {
30 size_t hash = FNV_offset_basis;
31 for (const char* pstr = text; pstr < text + byteLength; pstr++) {
32 hash ^= *pstr;
33 hash *= FNV_prime;
34 }
35 return hash;
36}
37
38template <int> size_t FNVHash(const char* text, const size_t byteLength);
39

Callers 2

FNVHash<4>Function · 0.85
FNVHash<8>Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected