MCPcopy Create free account
hub / github.com/opencontainers/go-digest / Encode

Method Encode

algorithm.go:140–144  ·  view source on GitHub ↗

Encode encodes the raw bytes of a digest, typically from a hash.Hash, into the encoded portion of the digest.

(d []byte)

Source from the content-addressed store, hash-verified

138// Encode encodes the raw bytes of a digest, typically from a hash.Hash, into
139// the encoded portion of the digest.
140func (a Algorithm) Encode(d []byte) string {
141 // TODO(stevvooe): Currently, all algorithms use a hex encoding. When we
142 // add support for back registration, we can modify this accordingly.
143 return fmt.Sprintf("%x", d)
144}
145
146// FromReader returns the digest of the reader using the algorithm.
147func (a Algorithm) FromReader(rd io.Reader) (Digest, error) {

Callers 1

NewDigestFromBytesFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected