Path: blob/main/files/en-us/web/http/headers/digest/index.md
6548 views
------{{HTTPSidebar}}
The Digest response HTTP header provides a {{Glossary("digest")}} of the selected representation of the requested resource.
Representations are different forms of a particular resource that might be returned from a request: for example, the same resource might be formatted in a particular media type such as XML or JSON, localized to a particular written language or geographical region, and/or compressed or otherwise encoded for transmission. The selected representation is the actual format of a resource that is returned following content negotiation, and can be determined from the response's {{Glossary("Representation header","Representation headers")}}.
The digest applies to the whole representation of a resource, not to a particular message. It can be used to verify that the representation data has not been modified during transmission.
Note: While a representation may be fully contained in the message body of a single response, it can also be sent using multiple messages in response to a range request, or omitted altogether in response to a {{HTTPMethod("HEAD")}} request.
| Header type | {{Glossary("Response header")}} |
|---|---|
| {{Glossary("Forbidden header name")}} | no |
Syntax
Directives
<digest-algorithm>: Digest algorithms are defined in Digest Headers.
Permitted digest algorithms values include:
unixsum,unixcksum,crc32c,sha-256andsha-512,id-sha-256,id-sha-512Deprecated algorithms values include:
md5,sha,adler32.
<digest-value>: The result of applying the digest algorithm to the resource representation and encoding the result. The choice of digest algorithm also determines the encoding to use: for example
SHA-256uses base64 encoding.
Examples
Specifications
{{Specifications}}
Browser compatibility
{{Compat}}
See also
{{HTTPHeader("Want-Digest")}}