Documentation
¶
Overview ¶
Package hash provides common utilities hashing kube objects and comparing hashes.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Object ¶
Object canonicalizes the object before hashing with xxhash
Example ¶
configmap := corev1.ConfigMap{ Data: map[string]string{ "some": "data", }, } hash, _ := Object(configmap) fmt.Println(Equal(hash, "n688h54h56ch64bh677h55fh648hddq"))
Output: true
func SecureObject ¶
SecureObject canonicalizes the object before hashing with sha512 and then with xxhash
Example ¶
secret := corev1.Secret{ StringData: map[string]string{ "some": "data", }, } hash, _ := SecureObject(secret) fmt.Println(SecureEqual(hash, "n665hb8h667h68hfbhffh669h54dq"))
Output: true
Types ¶
type ObjectHashFunc ¶
type ObjectHasher ¶
ObjectHasher hashes and object and can compare hashes for equality
func NewObjectHash ¶
func NewObjectHash() ObjectHasher
NewObjectHash returns a new ObjectHasher using Object
func NewSecureObjectHash ¶
func NewSecureObjectHash() ObjectHasher
NewSecureObjectHash returns a new ObjectHasher using SecureObject
Click to show internal directories.
Click to hide internal directories.