This class implements function to encode binary information to text encoding and vice versa.
More...
|
typedef std::vector< uint8_t > | Buffer |
| Definition of a vector holding characters. More...
|
|
|
static void | encode (const uint8_t *buffer, const size_t bufferSize, Buffer &encodedText) |
| Encodes binary information by application of Base64 to a text encoding. More...
|
|
static bool | decode (const uint8_t *encodedText, const size_t encodedTextSize, Buffer &buffer) |
| Decodes a text encoding by application of an inverse Base64 to binary information. More...
|
|
static void | encode3 (const uint8_t bytes3[3], uint8_t encoded4[4]) |
| Encodes 3 bytes of binary information to 4 bytes with text encoding. More...
|
|
static bool | decode4 (const uint8_t encoded4[4], uint8_t bytes3[3]) |
| Decodes 4 bytes with text encoding to 3 bytes of binary information. More...
|
|
static uint8_t | isEncoded (const uint8_t encodedValue) |
| Returns whether a given byte is text encoded. More...
|
|
|
static constexpr const char * | encodedCharacters_ = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" |
| The possible encoded characters. More...
|
|
This class implements function to encode binary information to text encoding and vice versa.
◆ Buffer
Definition of a vector holding characters.
◆ decode()
static bool Ocean::IO::Base64::decode |
( |
const uint8_t * |
encodedText, |
|
|
const size_t |
encodedTextSize, |
|
|
Buffer & |
buffer |
|
) |
| |
|
static |
Decodes a text encoding by application of an inverse Base64 to binary information.
- Parameters
-
encodedText | The encoded text to decode |
encodedTextSize | The size of the text to decode, in characters, with range [4, infinity) |
buffer | The resulting binary information |
- Returns
- True, if the given encoded text was valid
◆ decode4()
bool Ocean::IO::Base64::decode4 |
( |
const uint8_t |
encoded4[4], |
|
|
uint8_t |
bytes3[3] |
|
) |
| |
|
inlinestatic |
Decodes 4 bytes with text encoding to 3 bytes of binary information.
- Parameters
-
encoded4 | The four encoded byte to decode |
bytes3 | The resulting three text encoded bytes |
- Returns
- True, if succeeded
◆ encode()
static void Ocean::IO::Base64::encode |
( |
const uint8_t * |
buffer, |
|
|
const size_t |
bufferSize, |
|
|
Buffer & |
encodedText |
|
) |
| |
|
static |
Encodes binary information by application of Base64 to a text encoding.
- Parameters
-
buffer | The buffer to encode |
bufferSize | The size of the buffer to encode, in bytes, with range [1, infinity) |
encodedText | The resulting encoded text |
◆ encode3()
void Ocean::IO::Base64::encode3 |
( |
const uint8_t |
bytes3[3], |
|
|
uint8_t |
encoded4[4] |
|
) |
| |
|
inlinestatic |
Encodes 3 bytes of binary information to 4 bytes with text encoding.
- Parameters
-
bytes3 | The three bytes to encode |
encoded4 | The resulting four encoded bytes |
◆ isEncoded()
unsigned char Ocean::IO::Base64::isEncoded |
( |
const uint8_t |
encodedValue | ) |
|
|
inlinestatic |
Returns whether a given byte is text encoded.
- Parameters
-
encodedValue | The text encoded value to check |
- Returns
- The corresponding value with range [0, 59] if the value is text encoded, 64 otherwise
◆ encodedCharacters_
constexpr const char* Ocean::IO::Base64::encodedCharacters_ = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" |
|
staticconstexprprotected |
The possible encoded characters.
The documentation for this class was generated from the following file: