bitset_go

package module
v0.0.0-...-73b74c8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 14, 2021 License: MIT Imports: 1 Imported by: 0

README

go-bitset

Bitset implementation in Golang

Documentation

Index

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
}

func New

func New(length uint) *Bitset

New creates and returns a bitset of a specified length, with all bits set to 0

func (*Bitset) AppendBit

func (set *Bitset) AppendBit(bit uint8)

AppendBit appends a bit to the end of the bitset

func (*Bitset) AppendBitset

func (set *Bitset) AppendBitset(bitset *Bitset)

AppendBitset appends a bitset to another

func (*Bitset) Get

func (set *Bitset) Get(pos uint) (uint8, error)

Get returns the bit at a given position as a uint8

func (*Bitset) Length

func (set *Bitset) Length() uint

Length returns the length of the bitset

func (*Bitset) Set

func (set *Bitset) Set(pos uint) error

Set sets the bit in the bitset at a given position

func (*Bitset) Unset

func (set *Bitset) Unset(pos uint) error

Unset unsets the bit in the bitset at a given position

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL