commit 69129c2e932bd51dff02578e67ea79799380a3cc (tree)
parent 9684c99dd37ff987114824b2af17b6160b908b79
Author: andersfr <andersfr@gmail.com>
Date: Sat, 13 Jul 2019 13:57:32 +0200
Intentional wraparound used +
Diffstat:
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
@@ -523,6 +523,8 @@ set(ZIG_STD_FILES
"hash/crc.zig"
"hash/fnv.zig"
"hash/siphash.zig"
+ "hash/murmur.zig"
+ "hash/cityhash.zig"
"hash_map.zig"
"heap.zig"
"heap/logging_allocator.zig"
diff --git a/std/hash/cityhash.zig b/std/hash/cityhash.zig
@@ -217,7 +217,7 @@ pub const CityHash64 = struct {
const len: u64 = @truncate(u64, str.len);
if (len >= 8) {
const mul: u64 = k2 +% len *% 2;
- const a: u64 = fetch64(str.ptr) + k2;
+ const a: u64 = fetch64(str.ptr) +% k2;
const b: u64 = fetch64(str.ptr + str.len - 8);
const c: u64 = rotr64(b, 37) *% mul +% a;
const d: u64 = (rotr64(a, 25) +% b) *% mul;