authorgravatar for me@breakin.sebreakin <me@breakin.se> 2020-11-18 00:05:09+01:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-11-18 18:06:04-07:00
loge814f7105214c588f5df4c173ecf84dd3a11b01d
treee5570deaf6feac95b13fdca8f6fd7c53c2b0224b
parent50269f23155f65d702e3932f5a8bb08142e023ac

Change seed for Murmur2_64 from u32 to u64


1 files changed, 2 insertions(+), 2 deletions(-)

lib/std/hash/murmur.zig+2-2
...@@ -135,7 +135,7 @@ pub const Murmur2_64 = struct {...@@ -135,7 +135,7 @@ pub const Murmur2_64 = struct {
135 return @call(.{ .modifier = .always_inline }, Self.hashUint32WithSeed, .{ v, default_seed });135 return @call(.{ .modifier = .always_inline }, Self.hashUint32WithSeed, .{ v, default_seed });
136 }136 }
137137
138 pub fn hashUint32WithSeed(v: u32, seed: u32) u64 {138 pub fn hashUint32WithSeed(v: u32, seed: u64) u64 {
139 const m: u64 = 0xc6a4a7935bd1e995;139 const m: u64 = 0xc6a4a7935bd1e995;
140 const len: u64 = 4;140 const len: u64 = 4;
141 var h1: u64 = seed ^ (len *% m);141 var h1: u64 = seed ^ (len *% m);
...@@ -152,7 +152,7 @@ pub const Murmur2_64 = struct {...@@ -152,7 +152,7 @@ pub const Murmur2_64 = struct {
152 return @call(.{ .modifier = .always_inline }, Self.hashUint64WithSeed, .{ v, default_seed });152 return @call(.{ .modifier = .always_inline }, Self.hashUint64WithSeed, .{ v, default_seed });
153 }153 }
154154
155 pub fn hashUint64WithSeed(v: u64, seed: u32) u64 {155 pub fn hashUint64WithSeed(v: u64, seed: u64) u64 {
156 const m: u64 = 0xc6a4a7935bd1e995;156 const m: u64 = 0xc6a4a7935bd1e995;
157 const len: u64 = 8;157 const len: u64 = 8;
158 var h1: u64 = seed ^ (len *% m);158 var h1: u64 = seed ^ (len *% m);