base64 & '='

sims sims at
Mon May 29 06:47:34 CDT 2006

At 11:29 AM +0100 5/29/06, Dave Cragg wrote:
>On 29 May 2006, at 10:14, sims wrote:
>>When using base64Decode it seems that the '=' or '==' chars
>>at the end of a base64Encoded string are inconsequential. It
>>seems to make no difference if one '=', two '==' or none are at the
>>end of the string being decoded.
>>Is it safe to assume that any ending equal signs in a base64Encoded
>>string do not have to be in that string when I decode it?
>I've seen at least one base64 decode function (not Rev) where 
>stripping a final "=" does affect the output. So, without official 
>sanction from RunRev,  I'd be wary of assuming the way Rev handles 
>incomplete encoded strings will remain the same in future versions.
>But I take it you have a reason you want to drop the "=" characters. 
>Otherwise, why bother?

Yup...there is a reason.

I'll rephrase the question: there seems to be either 1 or 2 equal signs placed
at the end of a base64Encoded string. If I display it without any equal signs
but add a single equal sign when I decode the string, would I be safe?

[The "=" seems to be an item which indicates the end of a base64 string.]

iow - does it make any difference if there is 1 or 2 equal signs at the end?
With strings I've tested here it doesn't seem to make a difference.


European Rev Conference  2006

More information about the use-livecode mailing list