hashutils

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2019 License: Apache-2.0 Imports: 4 Imported by: 48

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HashAll

func HashAll(values ...interface{}) uint64

hash one or more values order matters Deprecated, use safe HashAllSafe

func HashAllSafe added in v0.11.1

func HashAllSafe(hasher hash.Hash64, values ...interface{}) (uint64, error)

hash one or more values order matters

This function returns the hashed result of all values passed into it. Any objects passed into it which fulfill the SafeHasher interface will be hashed this was, or using reflection if not. SafeHasher should be preferred. If no hasher is provided one will be provided. If a hasher is passed in, the returned hash can be ignored in favor of the hasher.

Types

type Hasher

type Hasher interface {
	Hash() uint64
}

Hashers are resources which have a custom hashing function defined. Hash functions are generated by default for go-utils resources Deprecated, use safe Hasher

type SafeHasher added in v0.11.1

type SafeHasher interface {
	Hash(hasher hash.Hash64) (uint64, error)
}

Jump to

Keyboard shortcuts

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