| 1 | // Package bitfield is an abstraction type for bitfield operations. |
| 2 | // |
| 3 | // A bitfield is also known as a Bitlist or BitvectorN in Ethereum 2.0 spec. |
| 4 | // Both variants are static arrays in that they cannot dynamically change in |
| 5 | // size after being constructed. These data types represent a list of bits whose |
| 6 | // value is treated akin to a boolean. The bits are in little endian order. |
| 7 | // |
| 8 | // BitvectorN - A list of bits that is fixed in size. |
| 9 | // Bitlist - A list of bits that is determined at runtime. |
| 10 | // |
| 11 | // The key difference between a bitvector and a bitlist is how they track the |
| 12 | // number of bits in the array. A bitvectorN is known to have N bits at compile |
| 13 | // time, so the length is always N no matter how the bitvector is instantiated. |
| 14 | // Whereas the bitlist can be created with size N at runtime. The bitlist uses |
| 15 | // the most significant bit in little endian order to indicate the start of the |
| 16 | // bitlist while in the byte representation. |
| 17 | package bitfieldscip-go gomod github.com/OffchainLabs/go-bitfield . `github.com/OffchainLabs/go-bitfield`/ |