The string "Base64" is strictly no valid Base64 string but decoding it with Guavas BaseEncoding utility does not fail because only the padding at the end is missing. This is the valid version of that string "Base64==" with correct padding.
And that is okay. Even Javas default Base64 decoder does not fail for that string.
But e.g. Jacksons ObjectMapper fails:
Unexpected end of base64-encoded String: base64 variant 'MIME-NO-LINEFEEDS' expects padding (one or more '=' characters) at the end
Is it possible to add a config forcePaddingOnDecoding() to force a strictly valid Base64 string while decoding?
That config would be in contrary to the encoding config omitPadding() that cuts the padding at the end of a Base64 string.
(Same for Base16, Base32, Base32Hex, Base64Url - of course.)
The string
"Base64"
is strictly no valid Base64 string but decoding it with GuavasBaseEncoding
utility does not fail because only the padding at the end is missing. This is the valid version of that string"Base64=="
with correct padding.And that is okay. Even Javas default
Base64
decoder does not fail for that string. But e.g. JacksonsObjectMapper
fails:Is it possible to add a config
forcePaddingOnDecoding()
to force a strictly valid Base64 string while decoding? That config would be in contrary to the encoding configomitPadding()
that cuts the padding at the end of a Base64 string.(Same for Base16, Base32, Base32Hex, Base64Url - of course.)