Skip to content
/ base64 Public

Simple public domain Base64 encoder and decoder with error checking.

License

Notifications You must be signed in to change notification settings

badzong/base64

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

base64

Simple Base64 encoder and decoder with error checking. Released to the public domain.

Usage:

#include <stdio.h>
#include <base64.h>

int main(void)
{
    char *encode = "foobar";
    char *decode = "YmFyZm9v";
    char buffer[32];
    char *p;

    base64_encode(buffer, sizeof buffer, encode, strlen(encode));
    printf("encode: %s: %s\n", encode, buffer);

    p = base64_enc_malloc(encode, strlen(encode));
    printf("encode %s: %s\n", encode, p);

    base64_decode(buffer, sizeof buffer, decode);
    printf("decode: %s: %s\n", decode, buffer);

    p = base64_dec_malloc(decode);
    printf("decode %s: %s\n", decode, p);

    return 0;
}

About

Simple public domain Base64 encoder and decoder with error checking.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages