struct Splitmix64Hash {
constexpr static auto splitmix64(uint64_t x) noexcept -> std::size_t {
x += 0x9e3779b97f4a7c15;
x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
return x ^ (x >> 31);
}
template <typename T>
requires std::is_integral_v<T>
auto operator() (const T &x) const noexcept -> std::size_t {
const static uint64_t FIXED_RANDOM = std::chrono::steady_clock::now().time_since_epoch().count();
return splitmix64(static_cast<uint64_t>(x) + FIXED_RANDOM);
}
};
template <typename Key, typename Value, typename Hash = Splitmix64Hash>
using HashMap = std::unordered_map<Key, Value, Hash>;
template <typename Value, typename Hash = Splitmix64Hash>
using HashSet = std::unordered_set<Value, Hash>;
$author$ $is$ $beiweibaka?$