Documentation ¶
Overview ¶
Package hashing provides utilities for calculating hashes.
Index ¶
Constants ¶
const ( HashMd5 = "MD5" HashSha256 = "SHA256" HashSha1 = "SHA1" HashMurmur = "Murmur" HashXXHash = "xxhash" // https://github.com/OneOfOne/xxhash HashBlake2256 = "blake2b256" // https://www.blake2.net/ )
Variables ¶
This section is empty.
Functions ¶
func CalculateHash ¶
CalculateHash calculates the hash of some text using the requested htype hashing algorithm.
func CalculateMD5Hash ¶
func CalculateStringHash ¶ added in v1.42.0
CalculateStringHash returns the hash of some text using a particular hashing algorithm
func HasLikelyHexHashStringEntropy ¶ added in v1.17.1
HasLikelyHexHashStringEntropy states whether a string has an entropy which may entail it is a hexadecimal hash This is based on the work done by `detect-secrets` https://github.com/Yelp/detect-secrets/blob/2fc0e31f067af98d97ad0f507dac032c9506f667/detect_secrets/plugins/high_entropy_strings.py#L150
func IsLikelyHexHashString ¶ added in v1.17.1
IsLikelyHexHashString determines whether the string is likely to be a hexadecimal hash or not.
Types ¶
type IHash ¶
type IHash interface { Calculate(reader io.Reader) (string, error) CalculateWithContext(ctx context.Context, reader io.Reader) (string, error) GetType() string }
IHash defines a hashing algorithm.
func NewBespokeHashingAlgorithm ¶ added in v1.42.0
NewBespokeHashingAlgorithm defines a bespoke hashing algorithm