1
0
Fork 0
mirror of https://github.com/Luzifer/scs-extract.git synced 2024-12-20 13:31:16 +00:00

Fix bug in hashing introduced in v1.0.0

This commit is contained in:
Knut Ahlers 2024-11-25 16:37:06 +01:00
parent d3a402464b
commit 1f77e1a486
Signed by: luzifer
SSH key fingerprint: SHA256:/xtE5lCgiRDQr8SLxHMS92ZBlACmATUmF1crK16Ks4E

View file

@ -161,7 +161,7 @@ func CityHash64(s []byte) uint64 {
// Decrease len to the nearest multiple of 64, and operate on 64-byte chunks. // Decrease len to the nearest multiple of 64, and operate on 64-byte chunks.
tmpLength := uint32(length) //#nosec:G115 // Should never be negative tmpLength := uint32(length) //#nosec:G115 // Should never be negative
tmpLength -= 1 & ^uint32(63) tmpLength = (tmpLength - 1) & ^uint32(63)
for { for {
x = rotate(x+y+v.Low64()+fetch64(s[8:]), 37) * k1 x = rotate(x+y+v.Low64()+fetch64(s[8:]), 37) * k1
y = rotate(y+v.High64()+fetch64(s[48:]), 42) * k1 y = rotate(y+v.High64()+fetch64(s[48:]), 42) * k1