|
Template Numerical Library version\ main:351d08c5f
|
Namespace for base64 encoding and decoding functions. More...
Functions | |
| std::pair< std::size_t, std::unique_ptr< std::uint8_t[] > > | decode (const char *data, const std::size_t data_size) |
| Do a base64 decoding of the given data. | |
| std::ptrdiff_t | decode_block (const char *input, std::size_t input_length, std::uint8_t *output, std::size_t output_length) |
| Internal base64 decoding function. | |
| std::unique_ptr< char[] > | encode (const std::uint8_t *data, std::size_t data_size) |
| Do a base64 encoding of the given data. | |
| std::size_t | get_encoded_length (std::size_t byte_length) |
| Get the length of base64-encoded block for given data byte length. | |
| template<typename HeaderType = std::uint64_t, typename T> | |
| void | write_encoded_block (const T *data, const std::size_t data_length, std::ostream &output_stream) |
| Write a base64-encoded block of data into the given stream. | |
Namespace for base64 encoding and decoding functions.
The actual algorithms are based on these sources:
|
inline |
Do a base64 decoding of the given data.
| data | Pointer to the encoded data (C string). |
| data_size | Length of the input string. |
|
inline |
Internal base64 decoding function.
| input | Pointer to the encoded data (C string). |
| input_length | Length of the input string. |
| output | Pointer to a pre-allocated output buffer. |
| output_length | Length of the output buffer. |
|
inline |
Do a base64 encoding of the given data.
| data | Pointer to the data to be encoded. |
| data_size | Length of the input data (in bytes). |
| void TNL::base64::write_encoded_block | ( | const T * | data, |
| const std::size_t | data_length, | ||
| std::ostream & | output_stream ) |
Write a base64-encoded block of data into the given stream.
The encoded data is prepended with a short header, which is the base64-encoded byte length of the data. The type of the byte length value is HeaderType.