bitarray

package
v4.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2019 License: BSD-3-Clause Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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