MCPcopy Create free account
hub / github.com/containerd/nerdctl / getAddrHash

Function getAddrHash

pkg/clientutil/client.go:99–115  ·  view source on GitHub ↗
(addr string)

Source from the content-addressed store, hash-verified

97}
98
99func getAddrHash(addr string) (string, error) {
100 const addrHashLen = 8
101
102 if runtime.GOOS != "windows" {
103 addr = strings.TrimPrefix(addr, "unix://")
104
105 var err error
106 addr, err = filepath.EvalSymlinks(addr)
107 if err != nil {
108 return "", err
109 }
110 }
111
112 d := digest.SHA256.FromString(addr)
113 h := d.Encoded()[0:addrHashLen]
114 return h, nil
115}

Callers 3

DataStoreFunction · 0.85
TestIssue2993Function · 0.85

Calls

no outgoing calls

Tested by 2

TestIssue2993Function · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…