From 296abbd35a600785d6297738749336061ecb2221 Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Wed, 30 Nov 2022 12:46:08 -0800 Subject: Reorder base64 unescape methods to be below the escaping methods. PiperOrigin-RevId: 491992941 Change-Id: Id66154cc4561770047b55625ef00014602975c5d --- absl/strings/escaping.h | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'absl/strings') diff --git a/absl/strings/escaping.h b/absl/strings/escaping.h index e8d2912b..d2c18e02 100644 --- a/absl/strings/escaping.h +++ b/absl/strings/escaping.h @@ -117,6 +117,22 @@ std::string Utf8SafeCEscape(absl::string_view src); // conversion. std::string Utf8SafeCHexEscape(absl::string_view src); +// Base64Escape() +// +// Encodes a `src` string into a base64-encoded 'dest' string with padding +// characters. This function conforms with RFC 4648 section 4 (base64) and RFC +// 2045. See also CalculateBase64EscapedLen(). +void Base64Escape(absl::string_view src, std::string* dest); +std::string Base64Escape(absl::string_view src); + +// WebSafeBase64Escape() +// +// Encodes a `src` string into a base64 string, like Base64Escape() does, but +// outputs '-' instead of '+' and '_' instead of '/', and does not pad 'dest'. +// This function conforms with RFC 4648 section 5 (base64url). +void WebSafeBase64Escape(absl::string_view src, std::string* dest); +std::string WebSafeBase64Escape(absl::string_view src); + // Base64Unescape() // // Converts a `src` string encoded in Base64 to its binary equivalent, writing @@ -135,22 +151,6 @@ bool Base64Unescape(absl::string_view src, std::string* dest); // padding, '=' and '.' are treated identically. bool WebSafeBase64Unescape(absl::string_view src, std::string* dest); -// Base64Escape() -// -// Encodes a `src` string into a base64-encoded 'dest' string with padding -// characters. This function conforms with RFC 4648 section 4 (base64) and RFC -// 2045. See also CalculateBase64EscapedLen(). -void Base64Escape(absl::string_view src, std::string* dest); -std::string Base64Escape(absl::string_view src); - -// WebSafeBase64Escape() -// -// Encodes a `src` string into a base64 string, like Base64Escape() does, but -// outputs '-' instead of '+' and '_' instead of '/', and does not pad 'dest'. -// This function conforms with RFC 4648 section 5 (base64url). -void WebSafeBase64Escape(absl::string_view src, std::string* dest); -std::string WebSafeBase64Escape(absl::string_view src); - // HexStringToBytes() // // Converts an ASCII hex string into bytes, returning binary data of length -- cgit v1.2.3