Use little endian bit order (#575)

Slightly more simple and common to find bit n at position `1 << n`
This commit is contained in:
Jacek Sieka 2019-02-12 12:52:07 +01:00 committed by Justin
parent 9a4f4d5344
commit f871b9a0d1
1 changed files with 1 additions and 1 deletions

View File

@ -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`