1
0
mirror of https://github.com/rancher/os.git synced 2025-09-02 07:15:41 +00:00

migrate to upstream libcompose in one and a half go

This commit is contained in:
Ivan Mikushin
2015-11-26 17:41:42 +05:00
parent 1d691cd8d6
commit 5a363ab97d
1291 changed files with 40107 additions and 123532 deletions

View File

@@ -70,15 +70,10 @@ func ParseDigest(s string) (Digest, error) {
return d, d.Validate()
}
// FromReader returns the most valid digest for the underlying content.
// FromReader returns the most valid digest for the underlying content using
// the canonical digest algorithm.
func FromReader(rd io.Reader) (Digest, error) {
digester := Canonical.New()
if _, err := io.Copy(digester.Hash(), rd); err != nil {
return "", err
}
return digester.Digest(), nil
return Canonical.FromReader(rd)
}
// FromTarArchive produces a tarsum digest from reader rd.