From 1f77e1a486ebec44e043818632c3114063990cf5 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Mon, 25 Nov 2024 16:37:06 +0100 Subject: [PATCH] Fix bug in hashing introduced in v1.0.0 --- b0rkhash/hash.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b0rkhash/hash.go b/b0rkhash/hash.go index 4cb7012..2dba5f0 100644 --- a/b0rkhash/hash.go +++ b/b0rkhash/hash.go @@ -161,7 +161,7 @@ func CityHash64(s []byte) uint64 { // Decrease len to the nearest multiple of 64, and operate on 64-byte chunks. tmpLength := uint32(length) //#nosec:G115 // Should never be negative - tmpLength -= 1 & ^uint32(63) + tmpLength = (tmpLength - 1) & ^uint32(63) for { x = rotate(x+y+v.Low64()+fetch64(s[8:]), 37) * k1 y = rotate(y+v.High64()+fetch64(s[48:]), 42) * k1