xxh3

package
v1.0.2019 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PRIME32_1 = 0x9E3779B1 /*!< 0b10011110001101110111100110110001 */
	PRIME32_2 = 0x85EBCA77 /*!< 0b10000101111010111100101001110111 */
	PRIME32_3 = 0xC2B2AE3D /*!< 0b11000010101100101010111000111101 */
	PRIME32_4 = 0x27D4EB2F /*!< 0b00100111110101001110101100101111 */
	PRIME32_5 = 0x165667B1 /*!< 0b00010110010101100110011110110001 */
)
View Source
const (
	PRIME64_1 uint64 = 0x9E3779B185EBCA87 // 0b1001111000110111011110011011000110000101111010111100101010000111
	PRIME64_2 uint64 = 0xC2B2AE3D27D4EB4F // 0b1100001010110010101011100011110100100111110101001110101101001111
	PRIME64_3 uint64 = 0x165667B19E3779F9 // 0b0001011001010110011001111011000110011110001101110111100111111001
	PRIME64_4 uint64 = 0x85EBCA77C2B2AE63 // 0b1000010111101011110010100111011111000010101100101010111001100011
	PRIME64_5 uint64 = 0x27D4EB2F165667C5 // 0b0010011111010100111010110010111100010110010101100110011111000101
)
View Source
const (
	PRIME_MX1 uint64 = 0x165667919E3779F9 /*!< 0b0001011001010110011001111001000110011110001101110111100111111001 */
	PRIME_MX2 uint64 = 0x9FB21C651E98DF25 /*!< 0b1001111110110010000111000110010100011110100110001101111100100101 */
)
View Source
const ACC_NB = STRIPE_LEN / 8 // 8  = unsafe.Sizeof(uint64)
View Source
const BlockSize128 = 256

The blocksize of XXH3_128 hash function in bytes

View Source
const BlockSize64 = 256

The blocksize of XXH3_64 hash function in bytes

View Source
const INTERNALBUFFER_SIZE = 256
View Source
const INTERNALBUFFER_STRIPES = INTERNALBUFFER_SIZE / STRIPE_LEN // 4
View Source
const KEYSET_DEFAULT_SIZE = 48 /* minimum 32 */
View Source
const MIDSIZE_LASTOFFSET = 17
View Source
const MIDSIZE_MAX = 240
View Source
const MIDSIZE_STARTOFFSET = 3
View Source
const SECRET_CONSUME_RATE = 8
View Source
const SECRET_DEFAULT_SIZE = 192
View Source
const SECRET_LASTACC_START = 7
View Source
const SECRET_MERGEACCS_START = 11
View Source
const SECRET_SIZE_MIN = 136
View Source
const STRIPE_LEN = 64
View Source
const Size128 = 16

The size of a XXH3_128 hash value in bytes

View Source
const Size64 = 8

The size of a XXH3_64 hash value in bytes

Variables

Functions

func Checksum64 added in v1.0.2017

func Checksum64(input []byte) uint64

Checksum64 returns the uint64 value.

func Checksum64WithSeed added in v1.0.2017

func Checksum64WithSeed(input []byte, seed uint64) uint64

Checksum64WithSeed returns the uint64 value.

func GenCustomSecret

func GenCustomSecret(customSecret []byte, seed64 uint64)

func Hash_64bits

func Hash_64bits(input []byte) uint64

func Hash_64bits_internal

func Hash_64bits_internal(
	input []byte,
	seed64 uint64,
	secret []byte,
	f_hashLong hashLong64_f,
) uint64

func Hash_64bits_withSecret

func Hash_64bits_withSecret(input []byte, secret []byte) uint64

func Hash_64bits_withSecretandSeed

func Hash_64bits_withSecretandSeed(
	input []byte,
	secret []byte,
	seed uint64,
) uint64

func Hash_64bits_withSeed

func Hash_64bits_withSeed(input []byte, seed uint64) uint64

func Hash_hashLong_64b_default added in v1.0.2017

func Hash_hashLong_64b_default(
	input []byte,
	seed64 uint64,
	secret []byte,
) uint64

func Hash_hashLong_64b_internal added in v1.0.2017

func Hash_hashLong_64b_internal(
	acc []uint64,
	input []byte,
	secret []byte,
) uint64

func Hash_hashLong_64b_withSecret

func Hash_hashLong_64b_withSecret(
	input []byte,
	seed64 uint64,
	secret []byte,
) uint64

func Hash_hashLong_64b_withSeed added in v1.0.2017

func Hash_hashLong_64b_withSeed(
	input []byte,
	seed uint64,
	secret []byte,
) uint64

func Hash_hashLong_64b_withSeed_internal added in v1.0.2017

func Hash_hashLong_64b_withSeed_internal(
	acc []uint64,
	input []byte,
	seed uint64,
) uint64

func New64

func New64() hash.Hash64

New64 returns a new hash.Hash64 computing the XXH3-64 checksum

func New64WithSecret

func New64WithSecret(secret []byte) (hash.Hash64, error)

New64WithSecret returns a new hash.Hash64 computing the XXH3-64 checksum

func New64WithSeed

func New64WithSeed(seed uint64) hash.Hash64

New64WithSeed returns a new hash.Hash64 computing the XXH3-64 checksum

func Sum128

func Sum128(input []byte) (out [Size128]byte)

Sum128 returns the 128bits Hash value.

func Sum128WithSeed

func Sum128WithSeed(input []byte, seed uint64) (out [Size128]byte)

Sum128WithSeed returns the 128bits Hash value.

func Sum64

func Sum64(input []byte) (out [Size64]byte)

Sum64 returns the 64bits Hash value.

func Sum64WithSeed

func Sum64WithSeed(input []byte, seed uint64) (out [Size64]byte)

Sum64WithSeed returns the 64bits Hash value.

Types

type Hash128

type Hash128 interface {
	hash.Hash
	Sum128() Uint128
}

Hash128

func New128

func New128() Hash128

New128 returns a new Hash128 computing the XXH3-128 checksum

func New128WithSecret

func New128WithSecret(secret []byte) (Hash128, error)

New128WithSecret returns a new Hash128 computing the XXH3-128 checksum

func New128WithSeed

func New128WithSeed(seed uint64) Hash128

New128WithSeed returns a new Hash128 computing the XXH3-128 checksum

type Uint128

type Uint128 struct {
	Low, High uint64
}

XXH128_hash_t

func Checksum128 added in v1.0.2017

func Checksum128(input []byte) Uint128

Checksum128 returns the Uint128 value.

func Checksum128WithSeed added in v1.0.2017

func Checksum128WithSeed(input []byte, seed uint64) Uint128

Checksum128WithSeed returns the Uint128 value.

func Hash_128bits

func Hash_128bits(input []byte) Uint128

func Hash_128bits_internal

func Hash_128bits_internal(
	input []byte,
	seed64 uint64,
	secret []byte,
	f_hl128 hashLong128_f,
) Uint128

func Hash_128bits_withSecret

func Hash_128bits_withSecret(input []byte, secret []byte) Uint128

func Hash_128bits_withSecretandSeed

func Hash_128bits_withSecretandSeed(
	input []byte,
	secret []byte,
	seed uint64,
) Uint128

func Hash_128bits_withSeed

func Hash_128bits_withSeed(input []byte, seed uint64) Uint128

func Hash_hashLong_128b_default

func Hash_hashLong_128b_default(
	input []byte,
	seed64 uint64,
	secret []byte,
) Uint128

func Hash_hashLong_128b_internal

func Hash_hashLong_128b_internal(
	acc []uint64,
	input []byte,
	secret []byte,
) Uint128

func Hash_hashLong_128b_withSecret

func Hash_hashLong_128b_withSecret(
	input []byte,
	seed64 uint64,
	secret []byte,
) Uint128

func Hash_hashLong_128b_withSeed

func Hash_hashLong_128b_withSeed(
	input []byte,
	seed64 uint64,
	secret []byte,
) Uint128

func Hash_hashLong_128b_withSeed_internal

func Hash_hashLong_128b_withSeed_internal(
	acc []uint64,
	input []byte,
	seed64 uint64,
) Uint128

func (Uint128) Bytes

func (u Uint128) Bytes() (out [16]byte)

Jump to

Keyboard shortcuts

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