Change seed for Murmur2_64 from u32 to u64

master
breakin 2020-11-18 00:05:09 +01:00 committed by Andrew Kelley
parent 2418c8206a
commit 6d3c176c12
1 changed files with 2 additions and 2 deletions

View File

@ -135,7 +135,7 @@ pub const Murmur2_64 = struct {
return @call(.{ .modifier = .always_inline }, Self.hashUint32WithSeed, .{ v, default_seed });
}
pub fn hashUint32WithSeed(v: u32, seed: u32) u64 {
pub fn hashUint32WithSeed(v: u32, seed: u64) u64 {
const m: u64 = 0xc6a4a7935bd1e995;
const len: u64 = 4;
var h1: u64 = seed ^ (len *% m);
@ -152,7 +152,7 @@ pub const Murmur2_64 = struct {
return @call(.{ .modifier = .always_inline }, Self.hashUint64WithSeed, .{ v, default_seed });
}
pub fn hashUint64WithSeed(v: u64, seed: u32) u64 {
pub fn hashUint64WithSeed(v: u64, seed: u64) u64 {
const m: u64 = 0xc6a4a7935bd1e995;
const len: u64 = 8;
var h1: u64 = seed ^ (len *% m);