Commit abd742f1 by Abseil Team Committed by Copybara-Service

Doc fix: state that Base64Escape does in fact produce padding. While at it,…

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
parent fe6ec8ef
...@@ -138,9 +138,8 @@ std::string WebSafeBase64Escape(absl::string_view src); ...@@ -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 // 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 // equivalent, writing it to a `dest` buffer, returning `true` on success. If
// `src` contains invalid characters, `dest` is cleared and returns `false`. // `src` contains invalid characters, `dest` is cleared and returns `false`.
// Padding is optional, and note that `Base64Escape()` does not produce it. If // If padding is included (note that `Base64Escape()` does produce it), it must
// padding is included, it must be correct. In the padding, '=' and '.' are // be correct. In the padding, '=' and '.' are treated identically.
// treated identically.
bool Base64Unescape(absl::string_view src, std::string* dest); bool Base64Unescape(absl::string_view src, std::string* dest);
// WebSafeBase64Unescape() // WebSafeBase64Unescape()
...@@ -148,8 +147,8 @@ bool Base64Unescape(absl::string_view src, std::string* dest); ...@@ -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 // 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 // its binary equivalent, writing it to a `dest` buffer. If `src` contains
// invalid characters, `dest` is cleared and returns `false`. If padding is // invalid characters, `dest` is cleared and returns `false`. If padding is
// included, it must be correct. In the padding, '=' and '.' are treated // included (note that `WebSafeBase64Escape()` does not produce it), it must be
// identically. // correct. In the padding, '=' and '.' are treated identically.
bool WebSafeBase64Unescape(absl::string_view src, std::string* dest); bool WebSafeBase64Unescape(absl::string_view src, std::string* dest);
// HexStringToBytes() // HexStringToBytes()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment