Use little endian bit order (#575)
Slightly more simple and common to find bit n at position `1 << n`
This commit is contained in:
parent
9a4f4d5344
commit
f871b9a0d1
|
@ -1077,7 +1077,7 @@ def get_bitfield_bit(bitfield: bytes, i: int) -> int:
|
|||
"""
|
||||
Extract the bit in ``bitfield`` at position ``i``.
|
||||
"""
|
||||
return (bitfield[i // 8] >> (7 - (i % 8))) % 2
|
||||
return (bitfield[i // 8] >> (i % 8)) % 2
|
||||
```
|
||||
|
||||
### `verify_bitfield`
|
||||
|
|
Loading…
Reference in New Issue