2020-06-21 19:18:43 +00:00
|
|
|
#ifndef WFP_UTIL_BASE64_H
|
|
|
|
#define WFP_UTILBASE64_H
|
2019-12-01 16:17:21 +00:00
|
|
|
|
|
|
|
#ifndef __cplusplus
|
|
|
|
#include <inttypes.h>
|
|
|
|
#include <stddef.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
#else
|
|
|
|
#include <cinttypes>
|
|
|
|
#include <cstddef>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
#endif
|
|
|
|
|
2020-06-17 14:54:09 +00:00
|
|
|
extern size_t wfp_impl_base64_encoded_size(size_t length);
|
2019-12-01 16:17:21 +00:00
|
|
|
|
2020-06-17 14:54:09 +00:00
|
|
|
extern size_t wfp_impl_base64_encode(
|
2019-12-01 16:17:21 +00:00
|
|
|
uint8_t const * data,
|
|
|
|
size_t length,
|
|
|
|
char * buffer,
|
|
|
|
size_t buffer_size);
|
|
|
|
|
2020-06-17 14:54:09 +00:00
|
|
|
extern size_t wfp_impl_base64_decoded_size(char const * data, size_t length);
|
2019-12-01 16:17:21 +00:00
|
|
|
|
2020-06-17 14:54:09 +00:00
|
|
|
extern size_t wfp_impl_base64_decode(
|
2019-12-01 16:17:21 +00:00
|
|
|
char const * data,
|
|
|
|
size_t length,
|
|
|
|
uint8_t * buffer,
|
|
|
|
size_t buffer_size);
|
|
|
|
|
2020-06-17 14:54:09 +00:00
|
|
|
extern bool wfp_impl_base64_isvalid(char const * data, size_t length);
|
2019-12-01 16:17:21 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|