Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClearBit ¶ added in v0.23.9
ClearBit clears the bit at index `i` in the byte slice `b`, i.e. it assigns value 0 to the bit. The function panics, if the byte slice is too short.
func MakeBitVector ¶ added in v0.23.9
MakeBitVector allocates a byte slice of minimal size that can hold numberBits.
func MinimalByteSliceLength ¶ added in v0.26.1
MinimalByteSliceLength returns the minimal length of a byte slice that can store n bits.
func ReadBit ¶ added in v0.23.9
ReadBit returns the bit at index `idx` in the byte array `b` (big endian) The function panics, if the byte slice is too short.
func SetBit ¶
SetBit sets the bit at index `i` in the byte array `b`, i.e. it assigns value 1 to the bit. The function panics, if the byte slice is too short.
func WriteBit ¶ added in v0.23.9
WriteBit assigns value `v` to the bit at index `i` in the byte array `b`. The function panics, if the byte slice is too short. We follow the common convention of converting between integer and boolean/bit values:
- int value == 0 <=> false <=> bit 0
- int value != 0 <=> true <=> bit 1
Types ¶
This section is empty.