mirror of
https://github.com/status-im/eth2.0-specs.git
synced 2025-02-16 12:36:25 +00: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:
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``.
|
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`
|
### `verify_bitfield`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user