bitfield

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2020 License: Apache-2.0, MIT Imports: 6 Imported by: 295

README

go-bitfield

CircleCI standard-readme compliant

Advanced RLE+ implementation

License

The Filecoin Project is dual-licensed under Apache 2.0 and MIT terms:

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBitFieldTooMany = errors.New("to many items in RLE")

Functions

This section is empty.

Types

type BitField

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

func IntersectBitField

func IntersectBitField(a, b *BitField) (*BitField, error)

func MergeBitFields

func MergeBitFields(a, b *BitField) (*BitField, error)

func MultiMerge

func MultiMerge(bfs ...*BitField) (*BitField, error)

func New

func New() BitField

func NewFromBytes

func NewFromBytes(rle []byte) (BitField, error)

func NewFromIter

func NewFromIter(r rlepluslazy.RunIterator) (*BitField, error)

func NewFromSet

func NewFromSet(setBits []uint64) *BitField

func SubtractBitField

func SubtractBitField(a, b *BitField) (*BitField, error)

func (BitField) All

func (bf BitField) All(max uint64) ([]uint64, error)

All returns all set set

func (BitField) AllMap

func (bf BitField) AllMap(max uint64) (map[uint64]bool, error)

func (*BitField) Copy

func (bf *BitField) Copy() (*BitField, error)

Copy flushes the bitfield and returns a copy that can be mutated without changing the original values

func (BitField) Count

func (bf BitField) Count() (uint64, error)

func (*BitField) First

func (bf *BitField) First() (uint64, error)

func (*BitField) ForEach

func (bf *BitField) ForEach(f func(uint64) error) error

func (*BitField) IsEmpty

func (bf *BitField) IsEmpty() (bool, error)

func (*BitField) IsSet

func (bf *BitField) IsSet(x uint64) (bool, error)

func (*BitField) MarshalCBOR

func (bf *BitField) MarshalCBOR(w io.Writer) error

func (*BitField) MarshalJSON

func (bf *BitField) MarshalJSON() ([]byte, error)

func (BitField) Set

func (bf BitField) Set(bit uint64)

Set ...s bit in the BitField

func (*BitField) Slice

func (bf *BitField) Slice(start, count uint64) (*BitField, error)

func (*BitField) UnmarshalCBOR

func (bf *BitField) UnmarshalCBOR(r io.Reader) error

func (*BitField) UnmarshalJSON

func (bf *BitField) UnmarshalJSON(b []byte) error

func (BitField) Unset

func (bf BitField) Unset(bit uint64)

Unset ...s bit in the BitField

Directories

Path Synopsis
rle

Jump to

Keyboard shortcuts

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