YAZ 5.37.0
base64.c File Reference

Base64 encode/decode utilities. More...

#include <string.h>
#include <yaz/base64.h>

Go to the source code of this file.

Functions

void yaz_base64encode (const char *in, char *out)
 encodes Base64 string
static int next_char (const char **in, size_t *len)
int yaz_base64decode (const char *in, char *out)
 decodes Base64 string

Detailed Description

Base64 encode/decode utilities.

Definition in file base64.c.

Function Documentation

◆ next_char()

int next_char ( const char ** in,
size_t * len )
static

Definition at line 61 of file base64.c.

Referenced by yaz_base64decode().

◆ yaz_base64decode()

int yaz_base64decode ( const char * in,
char * out )

decodes Base64 string

Parameters
ininput Base64 encoded string
outresult string
Return values
0OK
-1invalid character

The out buffer should at least be of size:

strlen(in)

Definition at line 82 of file base64.c.

References next_char().

Referenced by base64_render(), and yaz_srw_decodeauth().

◆ yaz_base64encode()

void yaz_base64encode ( const char * in,
char * out )

encodes Base64 string

Parameters
ininput string
outresulting Base64 string

The out buffer should at least be of size:

(strlen(in)*8) / 6 + 12

Definition at line 16 of file base64.c.

Referenced by connect_and_bind(), and z_HTTP_header_add_basic_auth().