Skip to main content

Module digest

Module digest 

Source
Expand description

Digests of a request’s body: the Digest header (RFC 3230) draft-cavage signatures cover, and the Content-Digest field (RFC 9530) RFC 9421 ones do.

Either may list several algorithms. Every one listed that is known here, SHA-256 or SHA-512, has to match the body, and at least one has to be there; the rest are ignored, as neither RFC lets a recipient check what it does not know.

Functions§

content_digest_matches
Whether a Content-Digest field holds the body’s digest: a structured-field dictionary of algorithms to byte sequences.
digest_matches
Whether a Digest header holds the body’s digest: SHA-256=…, possibly beside SHA-512=… or algorithms not known here, each base64.