Pair of functions to convert to/from base64.
More...
#include <ctype.h>
#include <stdint.h>
#include "base64.h"
#include "base64_luts.h"
#include <stdio.h>
#include <arpa/inet.h>
Go to the source code of this file.
|
| int | to64frombits_s (unsigned char *out, const unsigned char *in, int inlen, size_t outlen) |
| | Convert bytes array to base64.
|
| |
| int | to64frombits (unsigned char *out, const unsigned char *in, int inlen) |
| |
| int | from64tobits (char *out, const char *in) |
| | Convert base64 to bytes array.
|
| |
| int | from64tobits_fast (char *out, const char *in, int inlen) |
| |
| int | from64tobits_fast_with_bug (char *out, const char *in, int inlen) |
| |
Pair of functions to convert to/from base64.
Definition in file base64.c.
◆ bswap_16
| #define bswap_16 |
( |
|
x | ) |
((uint16_t) ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8))) |
◆ IS_BIG_ENDIAN
| #define IS_BIG_ENDIAN (1 == htons(1)) |
◆ IS_LITTLE_ENDIAN
◆ from64tobits()
| int from64tobits |
( |
char * |
out, |
|
|
const char * |
in |
|
) |
| |
Convert base64 to bytes array.
- Parameters
-
| out | output buffer in bytes. The buffer size must be at least (3 * size_of_in_buffer / 4) bytes long. |
| in | input base64 buffer |
| inlen | base64 buffer length |
- Returns
- 0 on success, -1 on failure.
Definition at line 114 of file base64.c.
◆ from64tobits_fast()
| int from64tobits_fast |
( |
char * |
out, |
|
|
const char * |
in, |
|
|
int |
inlen |
|
) |
| |
◆ from64tobits_fast_with_bug()
| int from64tobits_fast_with_bug |
( |
char * |
out, |
|
|
const char * |
in, |
|
|
int |
inlen |
|
) |
| |
◆ to64frombits()
| int to64frombits |
( |
unsigned char * |
out, |
|
|
const unsigned char * |
in, |
|
|
int |
inlen |
|
) |
| |
◆ to64frombits_s()
| int to64frombits_s |
( |
unsigned char * |
out, |
|
|
const unsigned char * |
in, |
|
|
int |
inlen, |
|
|
size_t |
outlen |
|
) |
| |
Convert bytes array to base64.
- Parameters
-
| out | output buffer in base64. The buffer size must be at least (4 * inlen / 3 + 4) bytes long. |
| in | input binary buffer |
| inlen | number of bytes to convert |
- Returns
- 0 on success, -1 on failure.
Definition at line 63 of file base64.c.