diff --git a/mulxp_hash.hpp b/mulxp_hash.hpp index 77a7952..818f276 100644 --- a/mulxp_hash.hpp +++ b/mulxp_hash.hpp @@ -277,12 +277,12 @@ inline std::uint64_t mul32( std::uint32_t x, std::uint32_t y ) return (std::uint64_t)x * y; } -inline std::uint32_t mulxp1_hash32( unsigned char const * p, std::size_t n, std::uint32_t seed ) +inline std::uint32_t mulxp1_hash32( unsigned char const * p, std::size_t n, std::uint64_t seed ) { std::uint32_t const q = 0x9e3779b9U; std::uint32_t const k = q * q; - std::uint64_t h = mul32( seed + q, k ); + std::uint64_t h = ( seed + q ) * k; std::uint32_t w = (std::uint32_t)h; h ^= n; @@ -319,12 +319,12 @@ inline std::uint32_t mulxp1_hash32( unsigned char const * p, std::size_t n, std: return (std::uint32_t)h ^ (std::uint32_t)(h >> 32); } -inline std::uint32_t mulxp3_hash32( unsigned char const * p, std::size_t n, std::uint32_t seed ) +inline std::uint32_t mulxp3_hash32( unsigned char const * p, std::size_t n, std::uint64_t seed ) { std::uint32_t const q = 0x9e3779b9U; std::uint32_t const k = q * q; - std::uint64_t h = mul32( seed + q, k ); + std::uint64_t h = ( seed + q ) * k; std::uint32_t w = (std::uint32_t)h; h ^= n;