package hashing

import "github.com/gohugoio/hugo/common/hashing"

Package hashing provides common hashing utilities.

Index

Functions

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 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 XxHashFromStringHexEncoded

func XxHashFromStringHexEncoded(f string) string

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

Source Files

hashing.go

Version
v0.139.2
Published
Nov 23, 2024
Platform
darwin/amd64
Imports
8 packages
Last checked
1 hour ago

Tools for package owners.