Francesco Lazzarino wrote:
> Md5 digests are 128 bits wide; encoded in hexadecimal is 32 bytes wide
> compared to 24 bytes in Base64, so space savings for 128 bit words is
> not a huge concern.
My concern is not space saving, and I agree that hex is easer to work
with. My concern stemmed from the fact that we may want to validate the
supplied digests with ones which we generate. It seems much safer to
check for an explicit statement of which encoding is used rather than
counting bytes or assuming that the de-facto standard is used.
> Matt, could you cite the part of the HTTP spec that specifies that MD5s
> be encoded Base64?
It is actually specified for the Content-MD5 header:
We are already creating Base64 digests for the Content-MD5 header field
and wondered if we could just reuse our code. Although our app does not
transport the actual object as the entity-body (we place it in a .zip
file), I can imagine a case where someone would. In that case, they may
want to use that digest and not have to decode and re-encode.
Again, I just noticed that it was not explicitly stated how to account
for alternate encodings of digests.