Documentation
¶
Overview ¶
Package hasher provides types and interfaces for hash calculating.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Hasher ¶
Hasher is the interface that storage hashers must implement. It provides low-level operations for hash calculating.
Implementations must accept nil and zero-length input and return the well-defined hash of the empty bit string for both. This matters because storage backends round-trip empty values as nil, so a read of a legitimately-empty value must hash without error.
func NewHexHasher ¶ added in v1.6.1
NewHexHasher wraps h so that Hash returns a lower-case hex-encoded digest.
func NewHexSHA1Hasher ¶ added in v1.6.1
func NewHexSHA1Hasher() Hasher
NewHexSHA1Hasher creates a SHA-1 hasher whose Hash output is hex-encoded.
func NewHexSHA256Hasher ¶ added in v1.6.1
func NewHexSHA256Hasher() Hasher
NewHexSHA256Hasher creates a SHA-256 hasher whose Hash output is hex-encoded.
func NewSHA1Hasher ¶
func NewSHA1Hasher() Hasher
NewSHA1Hasher creates a new NewSHA1Hasher instance.
func NewSHA256Hasher ¶
func NewSHA256Hasher() Hasher
NewSHA256Hasher creates a new sha256Hasher instance.