Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HashAll ¶
func HashAll(values ...interface{}) uint64
hash one or more values order matters Deprecated, use safe HashAllSafe
func HashAllSafe ¶ added in v0.11.1
func HashAllSafe(hasher hash.Hash64, values ...interface{}) (uint64, error)
hash one or more values order matters
This function returns the hashed result of all values passed into it. Any objects passed into it which fulfill the SafeHasher interface will be hashed this was, or using reflection if not. SafeHasher should be preferred. If no hasher is provided one will be provided. If a hasher is passed in, the returned hash can be ignored in favor of the hasher.
func HashableEqual ¶ added in v0.11.2
func HashableEqual(val1 interface{}, val2 interface{}) (equal bool, ok bool)
This function takes in any number of resources and attempts to compare them as safe hashers. If any are not safe hashers it will return !ok. If they are all safe hashers, it will compare the equality of all of them
Types ¶
type Hasher ¶
type Hasher interface {
Hash() uint64
}
Hashers are resources which have a custom hashing function defined. Hash functions are generated by default for go-utils resources Deprecated, use safe Hasher
type SafeHasher ¶ added in v0.11.1
type SafeHasher interface {
Hash(hasher hash.Hash64) (uint64, error)
}