bitset

package
v0.0.0-...-91ac70b Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: MIT Imports: 0 Imported by: 0

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
}

Bitset is an in-memory bitmap that is conceptually similar to []bool, but more memory efficient.

func New

func New(length int64) *Bitset

New returns a new in-memory bitset where you can set, clear and test for individual bits.

func (*Bitset) Clear

func (b *Bitset) Clear(off int64)

Clear sets the bit at position `off` to 0.

func (*Bitset) IsSet

func (b *Bitset) IsSet(off int64) bool

IsSet returns true if the bit at position `off` is 1.

func (*Bitset) Set

func (b *Bitset) Set(off int64)

Set sets the bit at position `off` to 1.

Jump to

Keyboard shortcuts

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