base64

Section: C Library Functions (3)
Index Return to Main Contents
 

NAME

base64 - decode and encode from/to BASE64  

SYNTAX

#include "base64.h"

int b64decode(in,len,out);

const unsigned char *in; int len;
stralloc *out;

int b64encode(in,out);

stralloc *int;
stralloc *out;

 

DESCRIPTION

b64decode translates the given BASE64 encoded string available at in of length len on input and returns the corresponding (binary) character stream on output. out is not '\0' terminated. b64decode respects BASE64 decoding defined by RFC 4648 in order to allow processing of URLs and path names.

The return value of b64decode is '0' in case of success and might be '-1' in case of memory shortage.

b64encode takes an input data stream in and translates it into the BASE64 format to be supplied at out potentially padded with trailing '='.

The return value of b64decode is '0' in case of success and might be '-1' in case of memory shortage.

 

SEE ALSO

RFC 2045, RFC 4648.


 

Index

NAME
SYNTAX
DESCRIPTION
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 16:57:43 GMT, January 25, 2026