anyone here got a function to find is a string is base64 encoded?
Wouter
wouter.abraham at pi.be
Sun Jul 25 21:28:09 EDT 2004
• From: Mark Brownell
• Subject: Re: anyone here got a function to find is a string is
base64 encoded?
• Date: Sun, 25 Jul 2004 18:02:48 -0700
>
> -- snip
>
> I use base64 for making text and binary data websafe. Knowing what my
> file format is makes it easy by file types and file extensions. This
> is fine for my needs but lousy for generic or unknown files. I was
> using numbers and spaces to get around the 32 kbt per line problem in
> fields. I now see that the spaces are not websafe. You could encounter
> spaces in attributes within well-formed XML. I guess what I'm saying
> is that if space is present then it can't be base64. I understand the
> need to verify every character though. You are trying to rule out that
> it can't be base64, I guess.
>
>
> Mark
Nope. Even spaces in the string won't harm the decoding. But it is not
*welfomed*.
The cutting up of a base64Encoded string in blocks of 72 chars is done
in MC/RR (to accomodate putting it in a field?). But it is no necessity
for the base64Decode function, as this takes out every char not in the
[1 - 9] + [a-Z] + "+" exept for the slash and the "=" (and may be some
other typable char, but I didn't test them all yet).
Wouter
More information about the use-livecode
mailing list