Encode and decode data using Base64.
More...
#include <poser/core/base64.h>
|
size_t | PSC_Base64_encodedLen (size_t size) |
| Calculate Base64-encoded size.
|
|
size_t | PSC_Base64_decodedSize (size_t len) |
| Calculate Base64-decoded size.
|
|
void | PSC_Base64_encodeTo (char *enc, const uint8_t *data, size_t size) |
| Base64-encode data to a given buffer.
|
|
char * | PSC_Base64_encode (const uint8_t *data, size_t size) |
| Base64-encode data to a newly created string.
|
|
void | PSC_Base64_decodeTo (uint8_t *data, const char *enc, size_t len) |
| Base64-decode a string to a given buffer.
|
|
uint8_t * | PSC_Base64_decode (const char *enc, size_t *size) |
| Base64-decode a string to a newly allocated buffer.
|
|
Encode and decode data using Base64.
Provides static methods to encode and decode binary data with Base64.
◆ PSC_Base64_decode()
uint8_t * PSC_Base64_decode |
( |
const char * |
enc, |
|
|
size_t * |
size |
|
) |
| |
|
static |
Base64-decode a string to a newly allocated buffer.
- Parameters
-
enc | the Base64-encoded string |
size | if not NULL, set this to the size of the decoded data |
- Returns
- a newly allocated buffer containing the decoded data
◆ PSC_Base64_decodedSize()
size_t PSC_Base64_decodedSize |
( |
size_t |
len | ) |
|
|
static |
Calculate Base64-decoded size.
- Parameters
-
len | the length of a Base64-encoded string |
- Returns
- the size of the decoded binary data
◆ PSC_Base64_decodeTo()
void PSC_Base64_decodeTo |
( |
uint8_t * |
data, |
|
|
const char * |
enc, |
|
|
size_t |
len |
|
) |
| |
|
static |
Base64-decode a string to a given buffer.
- Parameters
-
data | buffer to write the decoded data to, must have enough room for the decoded size |
enc | the Base64-encoded string |
len | the length of the Base64-encoded string |
◆ PSC_Base64_encode()
char * PSC_Base64_encode |
( |
const uint8_t * |
data, |
|
|
size_t |
size |
|
) |
| |
|
static |
Base64-encode data to a newly created string.
- Parameters
-
data | the binary data to encode |
size | the size of the binary data |
- Returns
- a newly allocated Base64-encoded string
◆ PSC_Base64_encodedLen()
size_t PSC_Base64_encodedLen |
( |
size_t |
size | ) |
|
|
static |
Calculate Base64-encoded size.
- Parameters
-
size | the size of some binary data |
- Returns
- the length of the Base64-encoded string
◆ PSC_Base64_encodeTo()
void PSC_Base64_encodeTo |
( |
char * |
enc, |
|
|
const uint8_t * |
data, |
|
|
size_t |
size |
|
) |
| |
|
static |
Base64-encode data to a given buffer.
- Parameters
-
enc | buffer to write Base64-encoded string to, must have enough room for the encoded string length plus a NUL terminator |
data | the binary data to encode |
size | the size of the binary data |
The documentation for this class was generated from the following file: