Documentation ¶
Index ¶
- type Bitset
- func (b *Bitset) Append(other *Bitset)
- func (b *Bitset) AppendBools(bits ...bool)
- func (b *Bitset) AppendByte(value byte, numBits int)
- func (b *Bitset) AppendBytes(data []byte)
- func (b *Bitset) AppendNumBools(num int, value bool)
- func (b *Bitset) AppendUint32(value uint32, numBits int)
- func (b *Bitset) At(index int) bool
- func (b *Bitset) Bits() []bool
- func (b *Bitset) ByteAt(index int) byte
- func (b *Bitset) Equals(other *Bitset) bool
- func (b *Bitset) Len() int
- func (b *Bitset) String() string
- func (b *Bitset) Substr(start int, end int) *Bitset
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bitset ¶
type Bitset struct {
// contains filtered or unexported fields
}
Bitset stores an array of bits.
func NewFromBase2String ¶
NewFromBase2String constructs and returns a Bitset from a string. The string consists of '1', '0' or ' ' characters, e.g. "1010 0101". The '1' and '0' characters represent true/false bits respectively, and ' ' characters are ignored.
The function panics if the input string contains other characters.
func (*Bitset) AppendBools ¶
AppendBools appends bits to the Bitset.
func (*Bitset) AppendByte ¶
AppendByte appends the numBits least significant bits from value.
func (*Bitset) AppendBytes ¶
AppendBytes appends a list of whole bytes.
func (*Bitset) AppendNumBools ¶
AppendNumBools appends num bits of value value.
func (*Bitset) AppendUint32 ¶
AppendUint32 appends the numBits least significant bits from value.
Click to show internal directories.
Click to hide internal directories.