#include "int-hash.hpp" #include namespace floormat { template static CORRADE_ALWAYS_INLINE T FNVHash(const char* str, size_t size) { const auto* end = str + size; T hash = offset_basis; for (; str != end; ++str) { hash *= prime; hash ^= (uint8_t)*str; } return hash; } size_t int_hash(uint32_t x) noexcept { if constexpr(sizeof(size_t) == 4) return FNVHash((const char*)&x, 4); else return int_hash(uint64_t(x)); } size_t int_hash(uint64_t x) noexcept { return FNVHash((const char*)&x, 8); } } // namespace floormat