common

package
v0.0.0-...-d98123c Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HashKeyMurmur3

func HashKeyMurmur3[T Hashable](key T, seed uint32) (uint64, error)

HashKeyMurmur3 uses NumToBytes to convert a numeric type to bytes and computes the hash value using Murmur3.

func HashKeySha256

func HashKeySha256[T Hashable](key T, seed uint32) (uint64, error)

HashKeySha256 uses NumToBytes to convert a numeric type to bytes and computes the hash value using SHA-256

func HashKeySha512

func HashKeySha512[T Hashable](key T, seed uint32) (uint64, error)

HashKeySha512 uses NumToBytes to convert a numeric type to bytes and computes the hash value using SHA-512

func HashKeySipHash

func HashKeySipHash[T Hashable](key T, seed uint32) (uint64, error)

HashKeySipHash uses NumToBytes to convert a numeric type to bytes and computes the hash value using SipHash

func HashKeyXXhash

func HashKeyXXhash[T Hashable](key T, seed uint32) (uint64, error)

HashKeyXXhash uses NumToBytes to convert a numeric type to bytes and computes the hash value using XX Hash

func NumToBytes

func NumToBytes[T Hashable](num T) ([]byte, error)

Types

type Hashable

type Hashable interface {
	~string | ~[]byte | ~int | ~int8 | ~int16 | ~int32 | ~int64 | ~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 |
		~float32 | ~float64
}

Hashable is an interface that represents types that can be hashed.

Jump to

Keyboard shortcuts

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