mirror of
https://github.com/ethereum/consensus-specs.git
synced 2026-02-03 00:24:56 -05:00
Use little endian bit order (#575)
Slightly more simple and common to find bit n at position `1 << n`
This commit is contained in:
@@ -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`
|
||||
|
||||
Reference in New Issue
Block a user