We needed a handle-based Base 64 encoder/decoder. Looked around the net, found a bunch of code that couldn't easily be adapted to in-memory stuff. Most of them work with files to conserve memory. This is inelegant in scripting environments such as Frontier.
C source code that makes it easy to encode handles in a MIME-compatible way.
I wrote an encoder/decoder. You can download the C source code at:
ftp://ftp.scripting.com/userland/base64Source.sit.hqx
I built this project using Symantec C++ 7.0.4 on a Mac 9500. You'll need Frontier SDK to build the project.
If you port this code to another platform please put the result on a website, and send me a pointer. Also send email if you think this isn't a compatible implementation of Base 64 encoding. I want to get it right.
BTW, I made it easy to port -- layering out the handle access routines. Of course there's a small performance penalty for this, and if you don't like it, change it. Thanks!
Frontier users
If you're using Frontier and want the Base 64 functionality, you can download system.extensions.base64:
ftp://ftp.scripting.com/userland/extensions.base64.sit.hqx
It installs in your Frontier.root, and adds two new verbs base64.encode and base64.decode. It will be part of the next release of Frontier.
Dave Winer
dwiner@well.comPS: The C source code for Base 64 is also on the website.
PPS: Jon Pugh adapted Base64 for HyperCard.
This page was last built with Frontier on a Macintosh on Wed, Oct 22, 1997 at 6:58:23 AM. Thanks for checking it out! Dave |