From f871b9a0d1cda472d620a368d8c3fb2cead33c12 Mon Sep 17 00:00:00 2001 From: Jacek Sieka Date: Tue, 12 Feb 2019 12:52:07 +0100 Subject: [PATCH] Use little endian bit order (#575) Slightly more simple and common to find bit n at position `1 << n` --- specs/core/0_beacon-chain.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/core/0_beacon-chain.md b/specs/core/0_beacon-chain.md index 0f0ad8f99..03be5ee17 100644 --- a/specs/core/0_beacon-chain.md +++ b/specs/core/0_beacon-chain.md @@ -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`