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 17:05:38-08:00
log6d3c176c127b3475a2202b0edd4855374c7ead30
tree0326ee2611cfd27db1f13fdea0494e3a71bb1a9d
parent2418c8206a81d1410850283ea6046c053a24851b

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);