anyone here got a function to find is a string is base64 encoded?

Mark Brownell gizmotron at earthlink.net
Sun Jul 25 21:01:59 EDT 2004


On Sunday, July 25, 2004, at 05:45 PM, Wouter wrote:

> Hi Mark,
>
> That's right.
> But checking if  each char i of the string is in 
> "abcdefghijklmnopqrstuvwxyz1234567890+/=" will take care of spaces.
> I hope or am I wrong?
>
> Wouter

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



More information about the use-livecode mailing list