mess822_base64

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

NAME

mess822_base64 - decode and encode from/to BASE64  

SYNTAX

#include <mess822.h>

int mess822_b64decode(out,in,len,flag);

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

int mess822_b64encode(out,in);

stralloc *out;
stralloc *in;

int mess822_b64urlencode(out,in);

stralloc *out;
stralloc *in;

 

DESCRIPTION

mess822_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. flag is typically '0' but could be set '1' in order to display decoding errors. Rather, if flag is set to '4648' it follows the decoding rules of RFC 4648 in order to allow processing of URLs and path names.

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

mess822_b64encode takes an input data stream in and translates it into the BASE64 format with maximum line length of 76 characters to be supplied at out.

On return, the number of BASE64 characters written is given. In case of memory shortage '-1' is provided.

mess822_b64urlencode performs the BASE64 encoding according to RFC 4648 ยง5 while otherwise is identical to mess822_b64encode.
   

SEE ALSO

mess822(3), mess822_quote(3), mess822_qp(3), mess822_token(3), RFC 4658.


 

Index

NAME
SYNTAX
DESCRIPTION
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 09:34:17 GMT, July 11, 2025