If iharder Base64 is used to decode urlsafe encoded Base64 which is missing the padding
iharder silently crops the result.
What I would have expected would be to either
- throw an Exception because of invalid input
- to be liberal in what you accept (http://tools.ietf.org/html/rfc1122#section-1.2.2)
and return the right result in spite of the missing padding
How it is done now is dangerous because it hides errors.
See the attached Testcase which tries to decode the urlsafe
by Apache Commons Codec 1.6 encoded string
"ACPI" and gets "ACP" as result.
This also destroys interoperability between iharder Base64 and other libraries used
for Base64 encoding. Since encoding and decoding are often done by different
components this is a severe bug.