Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions include/util/xor_fast_hash.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,11 @@ template <std::size_t MaxNumElements = (1u << 16u)> class XORFastHash
public:
XORFastHash()
{
std::mt19937 generator(1); // impl. defined but deterministic default seed
std::mt19937 generator(0xdeadbeef);
std::uniform_int_distribution<> distrib(0, UINT16_MAX);

std::iota(begin(table1), end(table1), 0u);
std::shuffle(begin(table1), end(table1), generator);

std::iota(begin(table2), end(table2), 0u);
std::shuffle(begin(table2), end(table2), generator);
std::fill(begin(table1), end(table1), distrib(generator));
std::fill(begin(table2), end(table2), distrib(generator));
}

inline std::uint16_t operator()(const std::uint32_t originalValue) const
Expand Down
Loading