MCPcopy Create free account
hub / github.com/davecheney/pub / addDigest

Function addDigest

internal/httpsig/sign.go:81–86  ·  view source on GitHub ↗
(req *http.Request, body []byte)

Source from the content-addressed store, hash-verified

79}
80
81func addDigest(req *http.Request, body []byte) {
82 hash := sha256.New()
83 hash.Write(body)
84 digest := hash.Sum(nil)
85 req.Header.Set("Digest", fmt.Sprintf("SHA-256=%s", base64.StdEncoding.EncodeToString(digest)))
86}

Callers 1

SignFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected