base64 Source Code in C
Introduction
This little utility implements the Base64
Content-Transfer-Encoding standard described in RFC1113
(http://www.faqs.org/rfcs/rfc1113.html). This is the coding scheme used by MIME to allow
binary data to be transferred by SMTP mail.
I was attempting to look at a mime attachment in a badly formed
e-mail one day. I was not able to find source that was simple to compile correctly
and would actually work. I have been working on a project where code similar to this
is in use. I decided that I would create a file similar to what I was looking for and make
it available to others.
Hosting on SourceForge
Hosting on SourceForge gives me a chance to work with their
system and with luck will allow the source to take on a life of its own. I will also
host the source on one of my sites just in case.
Design Goals
Specifically:
This code is a stand-alone utility to perform base64 encoding/decoding. It should be
genuinely useful when the need arises and it meets a need that is likely to occur for some
users. Code acts as sample code to show the author's design and coding style.
Generally:
This program is designed to survive: Everything you need is in a single source file. It
compiles cleanly using a vanilla ANSI C compiler. It does its job correctly with a minimum
of fuss. The code is not overly clever, not overly simplistic and not overly verbose.
Access is 'cut and paste' from a web page. Terms of use are reasonable.
Hidden Agenda
I am hoping that this little source file will have all its bugs
isolated and corrected in a single round of testing so that this beta code version
0.00.00B can actually be released as version 0.00.00R and stay there. Experience
tells me this is a real long shot, but having reviewed and unit-tested the code, I think
it's a possibility. It is, after all, a relatively simple utility.
How you can help:
I would be greatly obliged if you would compile the source and
run unit test. Don't bother if it has already been done for your
platforms/compilers. Take a look at the project and the news page to see what
platforms have been covered. If you have access to a platform that has not been
covered you can compile, run unit test and let us know the results.
Here is the source code in question: b64.c
|