Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var MaxIterations = 1024
The maximum number of iterations allowed before the populate function returns an error
Functions ¶
This section is empty.
Types ¶
type BinaryFuse ¶ added in v0.2.0
type BinaryFuse[T Unsigned] struct { Seed uint64 SegmentLength uint32 SegmentLengthMask uint32 SegmentCount uint32 SegmentCountLength uint32 Fingerprints []T }
func NewBinaryFuse ¶ added in v0.2.0
func NewBinaryFuse[T Unsigned](keys []uint64) (*BinaryFuse[T], error)
NewBinaryFuse fills the filter with provided keys. For best results, the caller should avoid having too many duplicated keys. The function may return an error if the set is empty.
func (*BinaryFuse[T]) Contains ¶ added in v0.2.0
func (filter *BinaryFuse[T]) Contains(key uint64) bool
Contains returns `true` if key is part of the set with a false positive probability.
type BinaryFuse8 ¶
type BinaryFuse8 BinaryFuse[uint8]
func PopulateBinaryFuse8 ¶
func PopulateBinaryFuse8(keys []uint64) (*BinaryFuse8, error)
PopulateBinaryFuse8 fills the filter with provided keys. For best results, the caller should avoid having too many duplicated keys. The function may return an error if the set is empty.
func (*BinaryFuse8) Contains ¶
func (filter *BinaryFuse8) Contains(key uint64) bool
Contains returns `true` if key is part of the set with a false positive probability of <0.4%.
Click to show internal directories.
Click to hide internal directories.