summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Abseil Team <absl-team@google.com>2023-01-19 08:55:27 -0800
committerGravatar Copybara-Service <copybara-worker@google.com>2023-01-19 08:56:13 -0800
commitabd742f12273e46c707e2c3fcd79fecd0ceacebe (patch)
treebc55974b49f7d36769c3242d43e3c44a81beb3a8
parentfe6ec8efabe2ca1f6d68d6c14087cdd58ea07136 (diff)
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
-rw-r--r--absl/strings/escaping.h9
1 files 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()