MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / HashBody

Function HashBody

internal/idempotency/store.go:106–109  ·  view source on GitHub ↗

HashBody returns the sha256 hex of the raw request body. Exposed so callers (the HTTP layer) can compute it once from the bytes they already read, rather than re-reading or re-encoding.

(body []byte)

Source from the content-addressed store, hash-verified

104// callers (the HTTP layer) can compute it once from the bytes they
105// already read, rather than re-reading or re-encoding.
106func HashBody(body []byte) string {
107 sum := sha256.Sum256(body)
108 return hex.EncodeToString(sum[:])
109}
110
111// HashRequest mixes the request path into the body hash so the same
112// Idempotency-Key cannot accidentally replay a cached response across

Calls

no outgoing calls