Documentation ¶
Index ¶
- Variables
- func BitIsNotSet(buf []byte, i int) bool
- func BitIsSet(buf []byte, i int) bool
- func BytesForBits(bits int64) int64
- func CeilByte(size int) int
- func CeilByte64(size int64) int64
- func ClearBit(buf []byte, i int)
- func CountSetBits(buf []byte, offset, n int) int
- func IsMultipleOf8(v int64) bool
- func NextPowerOf2(x int) int
- func SetBit(buf []byte, i int)
- func SetBitTo(buf []byte, i int, val bool)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( BitMask = [8]byte{1, 2, 4, 8, 16, 32, 64, 128} FlippedBitMask = [8]byte{254, 253, 251, 247, 239, 223, 191, 127} )
Functions ¶
func BitIsNotSet ¶
BitIsNotSet returns true if the bit at index i in buf is not set (0).
func BytesForBits ¶
func CeilByte64 ¶
CeilByte64 rounds size to the next multiple of 8.
func CountSetBits ¶
CountSetBits counts the number of 1's in buf up to n bits.
func IsMultipleOf8 ¶
IsMultipleOf8 returns whether v is a multiple of 8.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.