Commit 3e200f53 by Abseil Team Committed by Copybara-Service

Clarify that Base64 unescaping methods expect their inputs to match particular RFC specifications.

PiperOrigin-RevId: 500809781
Change-Id: I34d089343321f7658db8252ad29ff1824e6dbef2
parent 5169f3a4
...@@ -135,20 +135,21 @@ std::string WebSafeBase64Escape(absl::string_view src); ...@@ -135,20 +135,21 @@ std::string WebSafeBase64Escape(absl::string_view src);
// Base64Unescape() // Base64Unescape()
// //
// Converts a `src` string encoded in Base64 to its binary equivalent, writing // Converts a `src` string encoded in Base64 (RFC 4648 section 4) to its binary
// it to a `dest` buffer, returning `true` on success. If `src` contains invalid // equivalent, writing it to a `dest` buffer, returning `true` on success. If
// characters, `dest` is cleared and returns `false`. // `src` contains invalid characters, `dest` is cleared and returns `false`.
// Padding is optional. If padding is included, it must be correct. In the // Padding is optional, and note that `Base64Escape()` does not produce it. If
// padding, '=' and '.' are treated identically. // padding is included, it must be correct. In the padding, '=' and '.' are
// treated identically.
bool Base64Unescape(absl::string_view src, std::string* dest); bool Base64Unescape(absl::string_view src, std::string* dest);
// WebSafeBase64Unescape() // WebSafeBase64Unescape()
// //
// Converts a `src` string encoded in Base64 to its binary equivalent, writing // Converts a `src` string encoded in "web safe" Base64 (RFC 4648 section 5) to
// it to a `dest` buffer, but using '-' instead of '+', and '_' instead of '/'. // its binary equivalent, writing it to a `dest` buffer. If `src` contains
// If `src` contains invalid characters, `dest` is cleared and returns `false`. // invalid characters, `dest` is cleared and returns `false`. If padding is
// Padding is optional. If padding is included, it must be correct. In the // included, it must be correct. In the padding, '=' and '.' are treated
// padding, '=' and '.' are treated identically. // 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