commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Julius Davies (JIRA)" <>
Subject [jira] Commented: (CODEC-91) Handling of embedded padding in base64 encoded data changed in 1.4
Date Wed, 02 Jun 2010 00:49:41 GMT


Julius Davies commented on CODEC-91:

When we encode we tend to have at least 1 byte to encode == 8 bits.  Base64 results in 6 bits
of encoding per emitted byte, so modulus of 1 should be impossible.  That first encoded byte
will always result in two emitted bytes:   [6 bits] [2 bits].

Still it's good info to see that codec-1.4 accidentally changed the behaviour here.  I'll
create a new ticket based on Raphael's comment.

> Handling of embedded padding in base64 encoded data changed in 1.4
> ------------------------------------------------------------------
>                 Key: CODEC-91
>                 URL:
>             Project: Commons Codec
>          Issue Type: Bug
>    Affects Versions: 1.4
>            Reporter: Chris Pimlott
>         Attachments: codec-91-actually-works-and-tests-yay.patch
> 1.4 changed the way that embedded padding characters (i.e. "=") were handled when decoding
base64 data.  Previously, the decoder ignored them and decoded all the data.  Now it stops
upon encountering the first padding byte.  This breaks compatibility with previous versions.
> For example, in 1.4,
> b64.decode("Y29tbW9ucwo=".getBytes());
> gives the same result as
> b64.decode("Y29tbW9ucwo=Y29tbW9ucwo=".getBytes());

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message