hasher

package
v4.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2021 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Encode

func Encode(hasher *Murmur32Hasher, key string) (string, error)

Encode return the encoding of passed string

Types

type Hasher

type Hasher interface {
	Hash(data []byte) uint32
}

Hasher interface

type Murmur32Hasher

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

Murmur32Hasher is a hash function implementing the murmur3 32 bits algorithm

func NewMurmur332Hasher

func NewMurmur332Hasher(seed uint32) *Murmur32Hasher

NewMurmur332Hasher returns a new instance of the Murmur32Hasher

func (*Murmur32Hasher) Hash

func (h *Murmur32Hasher) Hash(data []byte) uint32

Hash returns the murmur3 (32 bits) hash of a byte slice.

Jump to

Keyboard shortcuts

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