mirror of
https://github.com/helm/helm.git
synced 2026-05-28 04:35:48 -04:00
fix(provenance): Ports error check for Digest to v3
This is a port of #5672 Signed-off-by: Taylor Thomas <taylor.thomas@microsoft.com>
This commit is contained in:
parent
faa9048580
commit
9b87721c1f
1 changed files with 3 additions and 1 deletions
|
|
@ -402,6 +402,8 @@ func DigestFile(filename string) (string, error) {
|
|||
// Helm uses SHA256 as its default hash for all non-cryptographic applications.
|
||||
func Digest(in io.Reader) (string, error) {
|
||||
hash := crypto.SHA256.New()
|
||||
io.Copy(hash, in)
|
||||
if _, err := io.Copy(hash, in); err != nil {
|
||||
return "", nil
|
||||
}
|
||||
return hex.EncodeToString(hash.Sum(nil)), nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue