bitarray

package
v4.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2019 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxSupportedNetmask = 32
)

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 int) (*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() int

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