|
CMSDK 2.0.1
Cross-platform C++ base library and SDK for the Psyclone AIOS platform
|
Base64 encoding/decoding of arbitrary binary data (standard alphabet, '=' padding). More...
#include <string>Go to the source code of this file.
Namespaces | |
| namespace | cmlabs |
Functions | |
| std::string | base64_encode (std::string string_to_encode) |
| Base64-encode a string's bytes. | |
| std::string | base64_encode (unsigned char const *, unsigned int len) |
| Base64-encode a raw buffer. | |
| std::string | base64_decode (const char *encoded_string) |
| Decode Base64 text. | |
| std::string | base64_decode (std::string const &s) |
| Decode Base64 text. | |
| bool | cmlabs::Base64_UnitTest () |
| Base64 round-trip unit test. | |
Base64 encoding/decoding of arbitrary binary data (standard alphabet, '=' padding).
Byte-order independent: Base64 operates on byte streams, so no endianness concerns arise. The functions live in the global namespace (third-party origin, adapted for CMSDK); the unit test is in cmlabs.
Definition in file Base64.h.
| std::string base64_decode | ( | const char * | encoded_string | ) |
Decode Base64 text.
| encoded_string | NUL-terminated encoded text. |
Definition at line 49 of file Base64.cpp.
References base64_decode().
Referenced by base64_decode(), cmlabs::Base64_UnitTest(), and cmlabs::HTTPRequest::decodeBasicAuthorization().
| std::string base64_decode | ( | std::string const & | s | ) |
Decode Base64 text.
| s | Encoded text. |
Definition at line 97 of file Base64.cpp.
References base64_chars, and is_base64().
| std::string base64_encode | ( | std::string | string_to_encode | ) |
Base64-encode a string's bytes.
| string_to_encode | Raw bytes (may contain NULs). |
Definition at line 44 of file Base64.cpp.
References base64_encode().
Referenced by cmlabs::RequestGateway::addAuthUser(), base64_encode(), cmlabs::Base64_UnitTest(), cmlabs::HTTPReply::createWebsocketHTTPReply(), cmlabs::HTTPRequest::createWebsocketRequest(), and cmlabs::HTTPRequest::setBasicAuthorization().
| std::string base64_encode | ( | unsigned char const * | bytes_to_encode, |
| unsigned int | len ) |
Base64-encode a raw buffer.
| bytes_to_encode | Input buffer. |
| len | Number of bytes. |
Definition at line 54 of file Base64.cpp.
References base64_chars.