Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HashFunction ¶ added in v2.2.1
HashFunction represents a function that creates a new hash.Hash
var ( SHA224 HashFunction = sha256.New224 SHA256 HashFunction = sha256.New SHA384 HashFunction = sha512.New384 SHA512 HashFunction = sha512.New SHA512_224 HashFunction = sha512.New512_224 SHA512_256 HashFunction = sha512.New512_256 )
Common hash functions
type Hasher ¶ added in v2.2.1
type Hasher struct {
// contains filtered or unexported fields
}
Hasher provides a unified interface for hashing operations
func NewHasher ¶ added in v2.2.1
func NewHasher(hf HashFunction) *Hasher
NewHasher creates a new Hasher with the specified hash function
func (*Hasher) CompareBytes ¶ added in v2.2.1
CompareBytes compares two hashes and returns true if they are equal
func (*Hasher) CompareString ¶ added in v2.2.1
CompareString compares two hashes and returns true if they are equal
func (*Hasher) GetBlockSize ¶ added in v2.2.1
GetBlockSize returns the block size of the hash in bytes
func (*Hasher) HashBytes ¶ added in v2.2.1
HashBytes returns the hexadecimal hash of the given byte slice
func (*Hasher) HashString ¶ added in v2.2.1
HashString returns the hexadecimal hash of the given string input
Click to show internal directories.
Click to hide internal directories.