absl::WebSafeBase64Escape

WebSafeBase64Escape overloads

Synopses

Declared in <absl/strings/escaping.h>

Encodes a src string into a base64 string, like Base64Escape() does, but outputs '-' instead of '+' and '_' instead of '/', and does not pad the output. This function conforms with RFC 4648 section 5 (base64url).

std::string
WebSafeBase64Escape(std::string_view src);
» more...

Deprecated overload of WebSafeBase64Escape() that writes to a dest buffer.

[[deprecated("Use the string-returning version of WebSafeBase64Escape()")]]
void
WebSafeBase64Escape(
    std::string_view src,
    std::string* dest);
» more...

Return Value

The web-safe base64-encoded string.

Parameters

NameDescription
srcThe string to encode.
destThe output string that receives the base64-encoded result.