Below is five different implementations of base64 decoding in C. I ended up collecting these over the course of a few hours late one night when hunting down a bug in my base64 decoder, having to do with line endings. The bug was that the encoded data was in multiple lines, and each line had to be treated as a seperate block to decode, whereas all of the decoders would treat them as one continuous block and end up corrupting the data after the first line.
In hacking them into my debug code, I changed them all to have binary safe semantics and put the result back in the string that was passed, returning the length of that decoded block. I only modified the first one to handle the line endings properly. I make no claims over this code, there are some notes in each file and all of them have their own copyrights/licenses that you can find by searching Google (where I found them) using the right keywords from their source.
| Name | Last modified | Size | Description | |
|---|---|---|---|---|
| Parent Directory | - | |||
| HEADER.html | 16-Jan-2003 01:35 | 1.0K | ||
| decode-1.c | 16-Jan-2003 01:29 | 2.3K | ||
| decode-2.c | 16-Jan-2003 01:29 | 2.2K | ||
| decode-3.c | 16-Jan-2003 01:29 | 4.6K | ||
| decode-4.c | 16-Jan-2003 01:29 | 1.1K | ||
| decode-5.c | 16-Jan-2003 01:29 | 1.0K | ||