bloom

package
v0.0.0-...-4aff305 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2018 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bits

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

func NewBits

func NewBits(len uint) *Bits

NewBits creates a new Bits of a required length

func (*Bits) Clear

func (b *Bits) Clear(i uint)

Clear removes a value from the Bits

func (*Bits) Contains

func (b *Bits) Contains(i uint) bool

Contains checks if the value is found with in the bits

func (*Bits) Len

func (b *Bits) Len() uint

Len returns the required length of the Bits

func (*Bits) Read

func (b *Bits) Read(r io.Reader) (int, error)

func (*Bits) Set

func (b *Bits) Set(i uint)

Set inserts a value into the Bits

func (*Bits) String

func (b *Bits) String() string

func (*Bits) Union

func (b *Bits) Union(other *Bits)

Union performs an inplace merge of two Bits

func (*Bits) Write

func (b *Bits) Write(w io.Writer) (int, error)

type Bloom

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

func New

func New(cap, recursions uint) *Bloom

func (*Bloom) Add

func (b *Bloom) Add(data string) error

Add data to the Bloom, returns an error if hashing fails.

func (*Bloom) Cap

func (b *Bloom) Cap() uint

Cap returns the capacity of the Bloom

func (*Bloom) Clear

func (b *Bloom) Clear(data string) error

Clear data from the Bloom, returns an error if hashing fails.

func (*Bloom) Contains

func (b *Bloom) Contains(data string) (bool, error)

Contains returns true if the data is in the Bloom or not. If true the result might be a false positive, if the result is false, the data is not in the set.

func (*Bloom) Read

func (b *Bloom) Read(r io.Reader) (int, error)

Read from the underlying bytes of the bloom.

func (*Bloom) String

func (b *Bloom) String() string

func (*Bloom) Union

func (b *Bloom) Union(other *Bloom) error

Union two blooms in place together Return error if the blooms can not be safely merged

func (*Bloom) Write

func (b *Bloom) Write(w io.Writer) (int, error)

Write a series of underlying bytes to the bloom. This wipes out any previous additions and starts from scratch.

Jump to

Keyboard shortcuts

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