hash

package
v0.27.6 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeTemplateHash added in v0.27.1

func ComputeTemplateHash(template interface{}) string

ComputeHash returns a hash value calculated from template and a collisionCount to avoid hash collision. The hash will be safe encoded to avoid bad words. It expects **template. In other words, you should pass an address of a DeepCopy result.

Proudly modified and adopted from k8s.io/kubernetes/pkg/util/hash.DeepHashObject and k8s.io/kubernetes/pkg/controller.ComputeHash.

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 FNVHashString added in v0.27.1

func FNVHashString(name string) string

func FNVHashStringObjects

func FNVHashStringObjects(objs ...interface{}) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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