absl::Base64Unescape

Converts a src string encoded in Base64 (RFC 4648 section 4) to its binary equivalent, writing it to a dest buffer, returning true on success. If src contains invalid characters, dest is cleared and returns false. If padding is included (note that Base64Escape() does produce it), it must be correct. In the padding, '=' and '.' are treated identically.

Synopsis

Declared in <absl/strings/escaping.h>

bool
Base64Unescape(
    std::string_view src,
    std::string* dest);

Return Value

true on success, false if src contains invalid characters.

Parameters

NameDescription
srcThe base64-encoded string to decode.
destThe output string that receives the decoded bytes.