Skip to content

Commit 3ef18a9

Browse files
authored
Consider the case where len is 128 (thanks @reissGRVS)
Signed-off-by: Xen <lordofxen@deskasoft.com>
1 parent 6449535 commit 3ef18a9

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

HashifyNet/Algorithms/CityHash/CityHash_Implementation.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ private UInt64 Hash64Len65Plus(ArraySegment<byte> data, CancellationToken cancel
487487
x = (x * K1) + BitConverter.ToUInt64(dataArray, 0);
488488

489489
// For each 64-byte chunk
490-
var groupEndOffset = dataOffset + (dataCount - (dataCount % 64));
490+
var groupEndOffset = dataOffset + ((dataCount - 1) - ((dataCount - 1) % 64));
491491

492492
for (var currentOffset = dataOffset; currentOffset < groupEndOffset; currentOffset += 64)
493493
{
@@ -796,4 +796,5 @@ private static UInt64 ReverseByteOrder(UInt64 operand)
796796
}
797797
#endregion
798798
}
799-
}
799+
800+
}

0 commit comments

Comments
 (0)