Documentation ¶
Index ¶
- type HyperLogLog
- func (hll *HyperLogLog) Add(pubkey string)
- func (hll *HyperLogLog) AddBytes(pubkey []byte)
- func (hll *HyperLogLog) Clear()
- func (hll *HyperLogLog) Count() uint64
- func (hll *HyperLogLog) GetRegisters() []byte
- func (hll *HyperLogLog) Merge(other *HyperLogLog)
- func (hll *HyperLogLog) MergeRegisters(other []byte)
- func (hll *HyperLogLog) SetRegisters(enc []byte)
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)
Click to show internal directories.
Click to hide internal directories.