MCPcopy Create free account
hub / github.com/D7EAD/mkPIVM / hash_string

Method hash_string

src/seed.cpp:61–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59 }
60
61 std::uint64_t SeedRng::hash_string(std::string_view s) noexcept {
62 // fnv-1a with a finalizer mix tacked on
63 std::uint64_t h = 0xCBF29CE484222325ULL;
64 for (unsigned char c : s) {
65 h ^= c;
66 h *= 0x100000001B3ULL;
67 }
68 h ^= h >> 33;
69 h *= 0xFF51AFD7ED558CCDULL;
70 h ^= h >> 33;
71 h *= 0xC4CEB9FE1A85EC53ULL;
72 h ^= h >> 33;
73 return h;
74 }
75}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected