MCPcopy
hub / github.com/helm/helm / key

Function key

pkg/downloader/manager.go:915–922  ·  view source on GitHub ↗

key is used to turn a name, such as a repository url, into a filesystem safe name that is unique for querying. To accomplish this a unique hash of the string is used.

(name string)

Source from the content-addressed store, hash-verified

913// safe name that is unique for querying. To accomplish this a unique hash of
914// the string is used.
915func key(name string) (string, error) {
916 in := strings.NewReader(name)
917 hash := crypto.SHA256.New()
918 if _, err := io.Copy(hash, in); err != nil {
919 return "", nil
920 }
921 return hex.EncodeToString(hash.Sum(nil)), nil
922}

Callers 2

TestKeyFunction · 0.85
ensureMissingReposMethod · 0.85

Calls 1

CopyMethod · 0.80

Tested by 1

TestKeyFunction · 0.68