hash

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const SaltLength = 32

SaltLength is the number of bytes which should be used as salt in hashing functions

Variables

View Source
var ErrSaltLengthMismatch = fmt.Errorf("provided salt is not %d length", SaltLength)

ErrSaltLengthMismath is used when the provided salt does not match the expected SaltLength

Functions

This section is empty.

Types

type Hasher

type Hasher interface {
	Hash64([]byte) uint64
}

Hasher implements different non cryptographic hashing functions

func NewMetroHasher

func NewMetroHasher(salt []byte) (Hasher, error)

NewMetroHasher returns a metro hasher that uses salt as a prefix to the bytes being summed

func NewMurmur3Hasher

func NewMurmur3Hasher(salt []byte) (Hasher, error)

NewMurmur3Hasher returns a Murmur3 hasher that uses salt as a prefix to the bytes being summed

Jump to

Keyboard shortcuts

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