identity

package
v3.4.0+incompatible Latest Latest
Warning

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

Go to latest
Published: May 11, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Accumulator

type Accumulator uint64

Accumulator is a commutative folding accumulator.

func NewAccumulator

func NewAccumulator() Accumulator

NewAccumulator creates a new Accumulator with a default seed value.

n.b. Here and elsewhere, we use nosplit to avoid stack size checks, which

are unnecessary as memory width is bounded to each instance of `a` (a
uint64) and, potentially, a single stack-local loop temporary while
iterating.

func NewAccumulatorWithSeed

func NewAccumulatorWithSeed(seed uint64) Accumulator

NewAccumulatorWithSeed creates a new Accumulator with the provided seed value.

func (Accumulator) AddString

func (a Accumulator) AddString(str string) Accumulator

AddString hashes str and folds it into the accumulator.

func (Accumulator) AddStrings

func (a Accumulator) AddStrings(strs ...string) Accumulator

AddStrings serially hashes and folds each of strs into the accumulator.

func (Accumulator) AddUint64

func (a Accumulator) AddUint64(u64 uint64) Accumulator

AddUint64 folds u64 into the accumulator.

func (Accumulator) AddUint64s

func (a Accumulator) AddUint64s(u64s ...uint64) Accumulator

AddUint64s serially folds each of u64s into the accumulator.

func (Accumulator) Value

func (a Accumulator) Value() uint64

Value returns the accumulated value.

Jump to

Keyboard shortcuts

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