Documentation ¶
Index ¶
Constants ¶
View Source
const (
SHA1 digest.Algorithm = "sha1"
)
Variables ¶
View Source
var (
// Canonical is the primary digest algorithm used to calculate checksums.
Canonical = digest.SHA256
)
Functions ¶
func AlgorithmForName ¶
AlgorithmForName returns the digest algorithm for the given name, or an error of type digest.ErrDigestUnsupported if the algorithm is unavailable.
Types ¶
type MultiDigester ¶
type MultiDigester struct {
// contains filtered or unexported fields
}
MultiDigester is a digester that writes to multiple digesters to calculate the checksum of different algorithms.
func NewMultiDigester ¶
func NewMultiDigester(algos ...digest.Algorithm) (*MultiDigester, error)
NewMultiDigester returns a new MultiDigester that writes to newly initialized digesters for the given algorithms. If a provided algorithm is not available, it returns a digest.ErrDigestUnsupported error.
func (*MultiDigester) Digest ¶
func (w *MultiDigester) Digest(algo digest.Algorithm) digest.Digest
Digest returns the digest of the data written to the digester of the given algorithm, or an empty digest if the algorithm is not available.
Click to show internal directories.
Click to hide internal directories.