Content-MD5

The Content-MD5 header is a very useful indicator for ensuring that the resource has arrived safely. The MD5 (Message Digest 5) algorithm is an extremely popular message digest algorithm that most developers are probably familiar with. It is sometimes referred to as a one-way algorithm, alluding to the fact that the digest cannot be converted back into the original document. This characteristic is due to the MD5 algorithm always producing a 128-bit (16-byte) result, regardless of the size of the input.

To include a Content-MD5 header in an HTTP message, the Web agent must calculate the MD5 sum of the content part of the message and convert it to a Base-64 format (see RFC 2045 for more information on Base-64). The reason for this ...

Get HTTP Developer’s Handbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.