Skip to content

Commit 4ad682d

Browse files
committed
clear the last nibble correctly
1 parent ff75a3e commit 4ad682d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crypto/statetrie/nibbles/nibbles_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func TestNibblesRandom(t *testing.T) {
4343
localRand.Read(data)
4444
half := localRand.Intn(2) == 0 // half of the time, we have an odd number of nibbles
4545
if half && localRand.Intn(2) == 0 {
46-
data[len(data)-1] |= 0x0f // sometimes clear the last nibble, sometimes do not
46+
data[len(data)-1] &= 0xf0 // sometimes clear the last nibble, sometimes do not
4747
}
4848
nibbles := MakeNibbles(data, half)
4949

0 commit comments

Comments
 (0)