helm: use digest lib for checksum calculation

Signed-off-by: Hidde Beydals <hello@hidde.co>
This commit is contained in:
Hidde Beydals 2023-01-13 13:13:17 +00:00
parent b89b049bf1
commit 909ece4092
1 changed files with 2 additions and 1 deletions

View File

@ -24,6 +24,7 @@ import (
"encoding/hex"
"errors"
"fmt"
"github.com/opencontainers/go-digest"
"io"
"net/url"
"os"
@ -302,7 +303,7 @@ func (r *ChartRepository) LoadIndexFromBytes(b []byte) error {
r.Lock()
r.Index = i
r.Checksum = fmt.Sprintf("%x", sha256.Sum256(b))
r.Checksum = digest.SHA256.FromBytes(b).Hex()
r.Unlock()
return nil
}