hash

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2023 License: Apache-2.0 Imports: 7 Imported by: 6

README

hash

Hash is a fast non-cryptographic hash function library, primarily intended for use in hash tables. Significant portions of this library are lifted from Go internals.

Documentation

https://godoc.org/github.com/arr-ai/hash

License

Portions of this software are taken from the Go source code at https://github.com/golang/go. These portions are licensed as per the LICENSE-GO file.

All other sources are licensed under the Apache 2.0 license as per the LICENSE file.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSeeds added in v0.5.0

func GetSeeds() (a []byte, h []uintptr)

GetSeeds returns the internal seeds used for computing hashes.

func SetSeeds added in v0.5.0

func SetSeeds(a []byte, h []uintptr) error

SetSeeds sets the internal seeds used for computing hashes.

Types

type Hashable

type Hashable interface {
	Hash(seed Seed) Seed
}

Hashable represents a type that can evaluate its own hash.

type Seed added in v1.0.0

type Seed = uintptr

func Any added in v1.0.0

func Any(i any, seed Seed) Seed

Interface returns a hash for i.

func Bool

func Bool(b bool, seed Seed) Seed

Bool returns a hash for b.

func Complex128

func Complex128(c complex128, seed Seed) Seed

Complex128 returns a hash for c.

func Complex64

func Complex64(c complex64, seed Seed) Seed

Complex64 returns a hash for c.

func Float32

func Float32(f float32, seed Seed) Seed

Float32 returns a hash for f.

func Float64

func Float64(f float64, seed Seed) Seed

Float64 returns a hash for f.

func Int

func Int(x int, seed Seed) Seed

Int returns a hash for x.

func Int16

func Int16(x int16, seed Seed) Seed

Int16 returns a hash for x.

func Int32

func Int32(x int32, seed Seed) Seed

Int32 returns a hash for x.

func Int64

func Int64(x int64, seed Seed) Seed

Int64 returns a hash for x.

func Int8

func Int8(x int8, seed Seed) Seed

Int8 returns a hash for x.

func Interface deprecated

func Interface(a any, seed Seed) Seed

Interface returns a hash for i.

Deprecated: Use Any instead.

func String

func String(s string, seed Seed) Seed

String returns a hash for s.

func Uint

func Uint(x uint, seed Seed) Seed

Uint returns a hash for x.

func Uint16

func Uint16(x uint16, seed Seed) Seed

Uint16 returns a hash for x.

func Uint32

func Uint32(x uint32, seed Seed) Seed

Uint32 returns a hash for x.

func Uint64

func Uint64(x uint64, seed Seed) Seed

Uint64 returns a hash for x.

func Uint8

func Uint8(x uint8, seed Seed) Seed

Uint8 returns a hash for x.

func Uintptr

func Uintptr(x, seed Seed) Seed

Uintptr returns a hash for x.

func UnsafePointer

func UnsafePointer(p unsafe.Pointer, seed Seed) Seed

UnsafePointer returns a hash for p

func Value

func Value(v reflect.Value, seed Seed) Seed

Value returns a hash for v.

Jump to

Keyboard shortcuts

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