Fix 64 bit hash_mix multiplier

This commit is contained in:
Peter Dimov
2022-09-17 02:34:14 +03:00
parent e391cf6841
commit b148e34818

View File

@@ -52,7 +52,7 @@ template<std::size_t Bits> struct hash_mix_impl;
// x *= 0xe9846af9b1a615d; // x *= 0xe9846af9b1a615d;
// x ^= x >> 32; // x ^= x >> 32;
// x *= 0xe9846af9b1a615d; // x *= 0xe9846af9b1a615d;
// x ^= x >> 28; // x ^= x >> 28;
// //
// An equally good alternative is Pelle Evensen's Moremur: // An equally good alternative is Pelle Evensen's Moremur:
// //
@@ -68,7 +68,7 @@ template<> struct hash_mix_impl<64>
{ {
inline static boost::uint64_t fn( boost::uint64_t x ) inline static boost::uint64_t fn( boost::uint64_t x )
{ {
boost::uint64_t const m = (boost::uint64_t(0xe9846af9) << 32) + 0xb1a615d; boost::uint64_t const m = (boost::uint64_t(0xe9846af) << 32) + 0x9b1a615d;
x ^= x >> 32; x ^= x >> 32;
x *= m; x *= m;