- // Fowler/Noll/Vo (FNV) hash (type FNV-1a).
- const unsigned char* p = reinterpret_cast<const unsigned char*>(s);
- if (sizeof(size_t) > 4)
- {
- size_t result = static_cast<size_t>(14695981039346656037ULL);
- for (size_t i = 0; i < length * sizeof(Stringpool_char); ++i)
- {
- result ^= static_cast<size_t>(*p++);
- result *= 1099511628211ULL;
- }
- return result;
- }
- else
- {
- size_t result = 2166136261UL;
- for (size_t i = 0; i < length * sizeof(Stringpool_char); ++i)
- {
- result ^= static_cast<size_t>(*p++);
- result *= 16777619UL;
- }
- return result;
- }