bitarray

package
v4.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2021 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxSupportedAllocLength = 23
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BitArray

type BitArray struct {
	// contains filtered or unexported fields
}

BitArray is type to represent an arbitrary long array of bits

func CreateBitArrayFromIpnet

func CreateBitArrayFromIpnet(ipnet *net.IPNet) (*BitArray, error)

func NewBitArray

func NewBitArray(len uint32) (*BitArray, error)

NewBitArray creates a new, empty BitArray object Returns error if length is zero, otherwise a pointer to the array

func NewBitArrayFromBase64

func NewBitArrayFromBase64(text string) *BitArray

NewBitArrayFromBase64 creates a new BitArray from a Base64 encoded string

func (*BitArray) Encode

func (arr *BitArray) Encode() string

Encode returns the Base64 encoded string of the BitArray

func (*BitArray) Get

func (arr *BitArray) Get(pos uint32) bool

Get returns whether the input position of the BitArray is set, or not

func (*BitArray) Len

func (arr *BitArray) Len() uint32

Len returns the length of the BitArray

func (*BitArray) Reset

func (arr *BitArray) Reset(pos uint32)

Reset unsets the bit at the input position of the BitArray

func (*BitArray) Set

func (arr *BitArray) Set(pos uint32)

Set sets the bit at the input position of the BitArray

Jump to

Keyboard shortcuts

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