MCPcopy Create free account
hub / github.com/github/copilot-sdk / hashFile

Function hashFile

go/internal/embeddedcli/embeddedcli.go:195–206  ·  view source on GitHub ↗

hashFile returns the SHA-256 hash of a file on disk.

(path string)

Source from the content-addressed store, hash-verified

193
194// hashFile returns the SHA-256 hash of a file on disk.
195func hashFile(path string) ([]byte, error) {
196 file, err := os.Open(path)
197 if err != nil {
198 return nil, err
199 }
200 defer file.Close()
201 h := sha256.New()
202 if _, err := io.Copy(h, file); err != nil {
203 return nil, err
204 }
205 return h.Sum(nil), nil
206}

Callers 2

installAtFunction · 0.85

Calls 2

OpenMethod · 0.65
CloseMethod · 0.65

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…