qb  2.0.0.0
C++17 Actor Framework
qb Issue Watch Star Fork Follow @isndev
Loading...
Searching...
No Matches
qb::crypto::base64 Class Reference

Base64 encoding and decoding utilities. More...

#include <crypto.h>

Static Public Member Functions

static std::string encode (const std::string &input) noexcept
 Encode a string to Base64.
static std::string decode (const std::string &base64) noexcept
 Decode a Base64 string.

Detailed Description

Base64 encoding and decoding utilities.

This nested class provides methods for encoding and decoding data in Base64 format, which is commonly used for representing binary data in a text format that can be safely transmitted in environments that only support ASCII.

Member Function Documentation

◆ encode()

std::string qb::crypto::base64::encode ( const std::string & input)
staticnoexcept

Encode a string to Base64.

Converts a string containing arbitrary binary data to a Base64-encoded string that contains only ASCII characters.

Parameters
inputThe string to encode
Returns
The Base64-encoded string

◆ decode()

std::string qb::crypto::base64::decode ( const std::string & base64)
staticnoexcept

Decode a Base64 string.

Converts a Base64-encoded string back to its original binary form.

Parameters
base64The Base64-encoded string to decode
Returns
The decoded binary string