hashing

package
v0.143.1 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package hashing provides common hashing utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Hash added in v0.143.0

func Hash(vs ...any) (uint64, error)

Hash returns a hash from vs.

func HashString

func HashString(vs ...any) string

HashString returns a hash from the given elements. It will panic if the hash cannot be calculated. Note that this hash should be used primarily for identity, not for change detection as it in the more complex values (e.g. Page) will not hash the full content.

func HashStringHex added in v0.141.0

func HashStringHex(vs ...any) string

HashStringHex returns a hash from the given elements as a hex encoded string. See HashString for more information.

func HashUint64

func HashUint64(vs ...any) uint64

HashUint64 returns a hash from the given elements. It will panic if the hash cannot be calculated. Note that this hash should be used primarily for identity, not for change detection as it in the more complex values (e.g. Page) will not hash the full content.

func MD5FromStringHexEncoded

func MD5FromStringHexEncoded(f string) string

MD5FromStringHexEncoded returns the MD5 hash of the given string.

func XXHashFromReader

func XXHashFromReader(r io.Reader) (uint64, int64, error)

XXHashFromReader calculates the xxHash for the given reader.

func XXHashFromString

func XXHashFromString(s string) (uint64, error)

XXHashFromString calculates the xxHash for the given string.

func XxHashFromReaderHexEncoded added in v0.141.0

func XxHashFromReaderHexEncoded(r io.Reader) (string, error)

XxHashFromReaderHexEncoded calculates the xxHash for the given reader and returns the hash as a hex encoded string.

func XxHashFromStringHexEncoded

func XxHashFromStringHexEncoded(f string) string

XxHashFromStringHexEncoded calculates the xxHash for the given string and returns the hash as a hex encoded string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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