Skip Menu |

This queue is for tickets about the Digest-MD5 CPAN distribution.

Report information
The Basics
Id: 85681
Status: rejected
Priority: 0/
Queue: Digest-MD5

People
Owner: Nobody in particular
Requestors: leonerd-cpan [...] leonerd.org.uk
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 2.51
Fixed in: (no value)



Subject: Outputs not-quite-valid base64 digests
The output of the md5_base64() function is not quite right. Technically, because its length isn't a multiple of 3 characters, it must be padded with '=' signs: $ perl -MDigest::MD5=md5_base64 -E 'say md5_base64 "Hello"' ixqZU8RhEpaoJ6v4xHgE1w $ perl -MDigest::MD5=md5 -MMIME::Base64=encode_base64 -E 'say encode_base64 md5 "Hello"' ixqZU8RhEpaoJ6v4xHgE1w== Without this, it doesn't qualify as a valid Base64 encoding for e.g. the Content-MD5 HTTP header. Some HTTP servers reject it, such as Amazon's S3: <Error><Code>InvalidDigest</Code><Message>The Content-MD5 you specified was invalid.</Message>... -- Paul Evans
It's a documented feature.  If your application requires the '==' just append it to the result of md5_base64().