From abd742f12273e46c707e2c3fcd79fecd0ceacebe Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Thu, 19 Jan 2023 08:55:27 -0800 Subject: Doc fix: state that Base64Escape does in fact produce padding. While at it, harmonize Base64Unescape and WebSafeBase64Unescape's documentation of padding. PiperOrigin-RevId: 503178146 Change-Id: Id216044a9f6520653e2fa3a4505ff05eddf55659 --- absl/strings/escaping.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/absl/strings/escaping.h b/absl/strings/escaping.h index f47cf736..7c082fef 100644 --- a/absl/strings/escaping.h +++ b/absl/strings/escaping.h @@ -138,9 +138,8 @@ std::string WebSafeBase64Escape(absl::string_view src); // 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`. -// Padding is optional, and note that `Base64Escape()` does not produce it. If -// padding is included, it must be correct. In the padding, '=' and '.' are -// treated identically. +// If padding is included (note that `Base64Escape()` does produce it), it must +// be correct. In the padding, '=' and '.' are treated identically. bool Base64Unescape(absl::string_view src, std::string* dest); // WebSafeBase64Unescape() @@ -148,8 +147,8 @@ bool Base64Unescape(absl::string_view src, std::string* dest); // Converts a `src` string encoded in "web safe" Base64 (RFC 4648 section 5) to // its binary equivalent, writing it to a `dest` buffer. If `src` contains // invalid characters, `dest` is cleared and returns `false`. If padding is -// included, it must be correct. In the padding, '=' and '.' are treated -// identically. +// included (note that `WebSafeBase64Escape()` does not produce it), it must be +// correct. In the padding, '=' and '.' are treated identically. bool WebSafeBase64Unescape(absl::string_view src, std::string* dest); // HexStringToBytes() -- cgit v1.2.3