package module
Version: v0.1.0 Latest Latest

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

Go to latest
Published: Mar 20, 2021 License: BSD-3-Clause Imports: 2 Imported by: 0



aeshash is a fast hash function extracted from the Go runtime that uses the Intel AESENC instruction. Used by Go's map.




This section is empty.


This section is empty.


func Hash

func Hash(b []byte, seed uint64) uint64

func Hash(p unsafe.Pointer, s, h uintptr) uintptr func HashStr(p string, s, h uintptr) uintptr

func Hash32

func Hash32(v uint32, s uint64) uint64

func Hash64

func Hash64(v uint64, s uint64) uint64

func HashStr

func HashStr(s string, seed uint64) uint64

func NewAES

func NewAES(seed uint64) nhash.Hash64


type StateAES

type StateAES struct {
	// contains filtered or unexported fields
 var (
	//_ hash.Hash   = new(Digest)
	_ nhash.Hash64     = new(StateAES)
	_ nhash.HashStream = new(StateAES)


func (*StateAES) BlockSize

func (d *StateAES) BlockSize() int

Return the blocksize of the hash which in this case is 1 byte.

func (*StateAES) Hash64

func (d *StateAES) Hash64(b []byte, seeds ...uint64) uint64

func (*StateAES) HashSizeInBits

func (d *StateAES) HashSizeInBits() int

Return the number of bits the hash function outputs.

func (*StateAES) NumSeedBytes

func (d *StateAES) NumSeedBytes() int

Return the maximum number of seed bypes required. In this case 2 x 32

func (*StateAES) Reset

func (d *StateAES) Reset()

Reset the hash state.

func (*StateAES) Size

func (d *StateAES) Size() int

Return the size of the resulting hash.

func (*StateAES) Sum

func (d *StateAES) Sum(b []byte) []byte

Return the current hash as a byte slice.

func (*StateAES) Sum64

func (d *StateAES) Sum64() uint64

Return the current hash as a 64 bit unsigned type.

func (*StateAES) Write

func (d *StateAES) Write(p []byte) (nn int, err error)

Accept a byte stream p used for calculating the hash. For now this call is lazy and the actual hash calculations take place in Sum() and Sum32().

func (*StateAES) Write64

func (d *StateAES) Write64(h uint64) (err error)

Source Files


Path Synopsis

Jump to

Keyboard shortcuts

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