package hashing
import "github.com/gohugoio/hugo/common/hashing"
Package hashing provides common hashing utilities.
Index ¶
- func Hash(vs ...any) (uint64, error)
- func HashString(vs ...any) string
- func HashStringHex(vs ...any) string
- func HashUint64(vs ...any) uint64
- func MD5FromStringHexEncoded(f string) string
- func XXHashFromReader(r io.Reader) (uint64, int64, error)
- func XXHashFromString(s string) (uint64, error)
- func XxHashFromReaderHexEncoded(r io.Reader) (string, error)
- func XxHashFromStringHexEncoded(f string) string
- type HashCloser
- type Hasher
Functions ¶
func Hash ¶
Hash returns a hash from vs.
func HashString ¶
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 ¶
HashStringHex returns a hash from the given elements as a hex encoded string. See HashString for more information.
func HashUint64 ¶
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 ¶
MD5FromStringHexEncoded returns the MD5 hash of the given string.
func XXHashFromReader ¶
XXHashFromReader calculates the xxHash for the given reader.
func XXHashFromString ¶
XXHashFromString calculates the xxHash for the given string.
func XxHashFromReaderHexEncoded ¶
XxHashFromReaderHexEncoded calculates the xxHash for the given reader and returns the hash as a hex encoded string.
func XxHashFromStringHexEncoded ¶
XxHashFromStringHexEncoded calculates the xxHash for the given string and returns the hash as a hex encoded string.
Types ¶
type HashCloser ¶
func XxHasher ¶
func XxHasher() HashCloser
XxHasher returns a Hasher that uses xxHash. Remember to call Close when done.
type Hasher ¶
type Hasher interface {
io.StringWriter
io.Writer
io.ReaderFrom
Sum64() uint64
}
Source Files ¶
- Version
- v0.153.4 (latest)
- Published
- Dec 28, 2025
- Platform
- linux/amd64
- Imports
- 9 packages
- Last checked
- 4 months ago –
Tools for package owners.