hyperloglog

package
v0.48.4 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2025 License: MIT Imports: 4 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HyperLogLog

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

Everything is hardcoded to use precision 8, i.e. 256 registers.

func New

func New(offset int) *HyperLogLog

func NewWithRegisters

func NewWithRegisters(registers []byte, offset int) *HyperLogLog

func (*HyperLogLog) Add

func (hll *HyperLogLog) Add(pubkey string)

Add takes a Nostr event pubkey which will be used as the item "key" (that combined with the offset)

func (*HyperLogLog) AddBytes

func (hll *HyperLogLog) AddBytes(pubkey []byte)

AddBytes is like Add, but takes pubkey as bytes instead of as string

func (*HyperLogLog) Clear

func (hll *HyperLogLog) Clear()

func (*HyperLogLog) Count

func (hll *HyperLogLog) Count() uint64

func (*HyperLogLog) GetRegisters

func (hll *HyperLogLog) GetRegisters() []byte

func (*HyperLogLog) Merge

func (hll *HyperLogLog) Merge(other *HyperLogLog)

func (*HyperLogLog) MergeRegisters

func (hll *HyperLogLog) MergeRegisters(other []byte)

func (*HyperLogLog) SetRegisters

func (hll *HyperLogLog) SetRegisters(enc []byte)

Jump to

Keyboard shortcuts

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