hash

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2021 License: GPL-3.0 Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HashFloat64

func HashFloat64(val float64, h stdHash.Hash)

Types

type Float64

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

func NewFloat64

func NewFloat64(val float64) (h Float64)

func (Float64) Hash

func (f Float64) Hash(h stdHash.Hash)

type Hash

type Hash stdHash.Hash

alias to the standard library Hash interface

type Hash32

type Hash32 stdHash.Hash32

type Hash64

type Hash64 stdHash.Hash64

type Hashable

type Hashable interface {
	Hash(h stdHash.Hash)
}

A type that can be hashed using the Hash interface

type HashablePair

type HashablePair struct {
	One, Two Hashable
}

func (HashablePair) Error

func (e HashablePair) Error() (s string)

func (HashablePair) Hash

func (hp HashablePair) Hash(h Hasher) (op OutPair)

type Hasher

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

func New

func New(hasher Hash) (h Hasher)

func (*Hasher) Append

func (h *Hasher) Append(hsb Hashable)

func (*Hasher) CalcHash

func (h *Hasher) CalcHash(hsb Hashable) (b []byte)

func (*Hasher) Hash

func (h *Hasher) Hash(hsb Hashable)

type Hasher32

type Hasher32 struct {
	Hasher
	stdHash.Hash32
}

func New32

func New32(hash32 stdHash.Hash32) (h Hasher32)

func (*Hasher32) CalcID

func (h *Hasher32) CalcID(hsb Hashable) (id ID32)

type Hasher64

type Hasher64 struct {
	Hasher
	stdHash.Hash64
}

func New64

func New64(hash64 stdHash.Hash64) (h Hasher64)

func (*Hasher64) CalcID

func (h *Hasher64) CalcID(hsb Hashable) (id ID64)

type ID32

type ID32 uint32

alias for return types of the Sum functions

type ID64

type ID64 uint64

type NotSame

type NotSame struct {
	StructPair HashablePair
	OutPair    OutPair
}

func (NotSame) Error

func (e NotSame) Error() (s string)

type OutPair

type OutPair struct {
	One, Two []byte
}

func (OutPair) Equals

func (o OutPair) Equals() (b bool)

func (OutPair) Error

func (e OutPair) Error() (s string)

type Tester

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

func NewTester

func NewTester(hasher Hasher) (t Tester)

func (Tester) SameHash

func (t Tester) SameHash(one, two Hashable) (err error)

func (Tester) SameHashPair

func (t Tester) SameHashPair(pair HashablePair) (err error)

func (Tester) TestSame

func (t Tester) TestSame(hashable Hashable) (err error)

func (Tester) TestSames

func (t Tester) TestSames(hashables []Hashable) (err error)

Jump to

Keyboard shortcuts

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