From ce8cf98532491617af05a183c6d5443ad63b2557 Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Thu, 12 Dec 2024 12:11:35 +0100 Subject: [PATCH] fix(unionlabs): little-endian bitvector --- lib/unionlabs/src/hash.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/unionlabs/src/hash.rs b/lib/unionlabs/src/hash.rs index 2acbccffce..d5853cc9f3 100644 --- a/lib/unionlabs/src/hash.rs +++ b/lib/unionlabs/src/hash.rs @@ -57,7 +57,7 @@ impl<'a> BytesBitIterator<'a> { // debug_assert_eq!(self.hash_bytes.len(), Hash::LENGTH); // invariant // debug_assert_lt!(index, Hash::LENGTH_IN_BITS); // assumed precondition let pos = index / 8; - let bit = 7 - index % 8; + let bit = index % 8; (self.bz[pos] >> bit) & 1 != 0 } }