Featured post
Remove trailing "=" when base64 encoding -
i noticing whenever base64 encode string, "=" appended @ end. can remove character , reliably decode later adding back, or dangerous? in other words, "=" always appended, or in cases?
i want encoded string short possible, that's why want know if can remove "=" character , add before decoding.
thanks
the =
padding.
wikipedia says
an additional pad character allocated may used force encoded output integer multiple of 4 characters (or equivalently when unencoded binary text not multiple of 3 bytes) ; these padding characters must discarded when decoding still allow calculation of effective length of unencoded text, when input binary length not multiple of 3 bytes (the last non-pad character encoded last 6-bit block represents zero-padded on least significant bits, @ 2 pad characters may occur @ end of encoded stream).
if control other end, remove when in transport, re-insert (by checking string length) before decoding.
note data not valid base64 in transport.
- Get link
- X
- Other Apps
Comments
Post a Comment