1 #ifndef _C4_BASE64_HPP_
2 #define _C4_BASE64_HPP_
10 #include "c4/blob.hpp"
70 template<
typename CharOrConstChar>
73 blob_<CharOrConstChar>
data;
84 template<
class ...Args>
95 template<
class ...Args>
107 template<
class ...Args>
Lightweight generic type-safe wrappers for converting individual values to/from strings.
base64_wrapper_< byte > base64_wrapper
a tag type to mark a payload to be encoded as base64
const_base64_wrapper cbase64(Args const &...args)
mark a variable to be written in base64 format
const_base64_wrapper base64(Args const &...args)
mark a variable to be written in base64 format
base64_wrapper_< cbyte > const_base64_wrapper
a tag type to mark a payload as base64-encoded
size_t base64_encode(substr encoded, cblob data)
base64-encode binary data.
bool base64_valid(csubstr encoded)
check that the given buffer is a valid base64 encoding
size_t base64_decode(csubstr encoded, blob data)
decode the base64 encoding in the given buffer
bool from_chars(csubstr buf, uint8_t *v) noexcept
size_t to_chars(substr buf, uint8_t v) noexcept
base64_wrapper_(blob_< CharOrConstChar > blob)
blob_< CharOrConstChar > data