mirror of
https://github.com/containers/skopeo.git
synced 2025-09-24 11:26:59 +00:00
Vendor after merging https://github.com/containers/image/pull/275
This commit is contained in:
8
vendor/github.com/opencontainers/go-digest/algorithm.go
generated
vendored
8
vendor/github.com/opencontainers/go-digest/algorithm.go
generated
vendored
@@ -125,6 +125,14 @@ func (a Algorithm) Hash() hash.Hash {
|
||||
return algorithms[a].New()
|
||||
}
|
||||
|
||||
// Encode encodes the raw bytes of a digest, typically from a hash.Hash, into
|
||||
// the encoded portion of the digest.
|
||||
func (a Algorithm) Encode(d []byte) string {
|
||||
// TODO(stevvooe): Currently, all algorithms use a hex encoding. When we
|
||||
// add support for back registration, we can modify this accordingly.
|
||||
return fmt.Sprintf("%x", d)
|
||||
}
|
||||
|
||||
// FromReader returns the digest of the reader using the algorithm.
|
||||
func (a Algorithm) FromReader(rd io.Reader) (Digest, error) {
|
||||
digester := a.Digester()
|
||||
|
Reference in New Issue
Block a user