hll

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2025 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultLog2m    = 31
	DefaultRegwidth = 8
)

Variables

View Source
var DefaultSettings = hll.Settings{
	Log2m:             DefaultLog2m,
	Regwidth:          DefaultRegwidth,
	ExplicitThreshold: hll.AutoExplicitThreshold,
	SparseEnabled:     true,
}

Functions

func GetBytes

func GetBytes(key interface{}) ([]byte, error)

Types

type HyperLogLog

type HyperLogLog struct {
	HLL hll.Hll
}

func FromBytes

func FromBytes(raw []byte) (*HyperLogLog, error)

func New

func New() (*HyperLogLog, error)

func (*HyperLogLog) Add

func (h *HyperLogLog) Add(data []byte)

func (*HyperLogLog) AddAny

func (h *HyperLogLog) AddAny(data any) error

func (*HyperLogLog) Count

func (h *HyperLogLog) Count() uint64

func (*HyperLogLog) IntersectionCount

func (h *HyperLogLog) IntersectionCount(h2 *HyperLogLog) (uint64, error)

func (*HyperLogLog) ToBytes

func (h *HyperLogLog) ToBytes() []byte

func (*HyperLogLog) Union

func (h *HyperLogLog) Union(h2 *HyperLogLog) (*HyperLogLog, error)

func (*HyperLogLog) UnionCount

func (h *HyperLogLog) UnionCount(h2 *HyperLogLog) (uint64, error)

Jump to

Keyboard shortcuts

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