GREM 3.12.0
Game/Rendering Engine Modules for C++
Loading...
Searching...
No Matches
grem::base64 Namespace Reference

Functions

String encode (StringView data)
 Encode arbitrary data into a Base64 string.
String decode (StringView string)
 Decode the original data from a Base64 string.

Function Documentation

◆ encode()

String grem::base64::encode ( StringView data)

Encode arbitrary data into a Base64 string.

Parameters
datainput data to encode.
Returns
a Base64 string containing the encoded representation of the input.
Exceptions
std::length_errorif the length of the encoded string exceeds the maximum supported string size.
std::bad_allocon allocation failure.

◆ decode()

String grem::base64::decode ( StringView string)

Decode the original data from a Base64 string.

Parameters
stringBase64 string to decode.
Returns
a byte sequence containing the data decoded from the Base64 string.
Exceptions
std::invalid_argumentif the length of the Base64 string is not divisible by 4.
std::length_errorif the length of the decoded byte sequence exceeds the maximum supported string size.
std::bad_allocon allocation failure.