Digest

Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

The Digest response HTTP header provides a 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 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 HEAD request.

Header type Response header
Forbidden header name no

Syntax

http

Digest: <digest-algorithm>=<digest-value>
Digest: <digest-algorithm>=<digest-value>,<digest-algorithm>=<digest-value>

Directives

<digest-algorithm>

Digest algorithms are defined in Digest Headers.

  • Permitted digest algorithms values include: unixsum, unixcksum, crc32c, sha-256 and sha-512, id-sha-256, id-sha-512
  • Deprecated 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-256 uses base64 encoding.

Examples

http

Digest: sha-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=
Digest: sha-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=,unixsum=30637

Specifications

Specification
Digest Fields
# section-3

Browser compatibility

BCD tables only load in the browser

See also