hash

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package hash contains useful functionality for hashing.

This package is copied from:

https://github.com/kubernetes/kubernetes/blob/b695d79d4f967c403a96986f1750a35eb75e75f1/pkg/util/hash/hash.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeHash added in v0.3.0

func ComputeHash(obj interface{}) string

ComputeHash computes hash value of a interface

func DeepHashObject

func DeepHashObject(hasher hash.Hash, objectToWrite interface{})

DeepHashObject writes specified object to hash using the spew library which follows pointers and prints actual values of the nested objects ensuring the hash does not change when a pointer changes.

func HashFolder added in v0.7.0

func HashFolder(ctx context.Context, folder string, filters ...HashFolderFilter) (hash string, err error)

HashFolder generates a hash for the folder

func HashSHA256 added in v0.3.0

func HashSHA256(secretKey string, value []byte) (string, error)

HashSHA256 will generate a hash value using SHA-256.

Types

type HashFolderFilter added in v0.7.0

type HashFolderFilter func(context context.Context, path string, d fs.DirEntry) bool

func IgnoreFilesFilter added in v0.7.0

func IgnoreFilesFilter(patterns ...string) HashFolderFilter

Jump to

Keyboard shortcuts

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