cachehash

package
v0.0.0-...-6680040 Latest Latest
Warning

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

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

Documentation

Overview

Package cachehash generates non-cryptographic cache keys.

The functions in this package make no guarantees about the underlying hashing algorithm. It should only be used for caching, where it's ok if the hash for a given input changes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bytes

func Bytes(b []byte) string

Bytes returns a hex-encoded hash of b.

func Bytes6

func Bytes6(b []byte) string

Bytes6 returns the first 6 characters of the hash of b.

func File

func File(path string) (string, error)

File returns a hex-encoded hash of a file's contents.

func JSON

func JSON(a any) (string, error)

JSON marshals a to JSON and returns its hex-encoded hash.

func JSONFile

func JSONFile(path string) (string, error)

JSONFile compacts the JSON in a file and returns its hex-encoded hash.

Types

This section is empty.

Jump to

Keyboard shortcuts

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