Skip to content

Commit

Permalink
Doc fix: state that Base64Escape does in fact produce padding. While …
Browse files Browse the repository at this point in the history
…at it, harmonize Base64Unescape and WebSafeBase64Unescape's documentation of padding.

PiperOrigin-RevId: 503178146
Change-Id: Id216044a9f6520653e2fa3a4505ff05eddf55659
  • Loading branch information
Abseil Team authored and Copybara-Service committed Jan 19, 2023
1 parent fe6ec8e commit abd742f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions absl/strings/escaping.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,18 +138,17 @@ 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()
//
// 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()
Expand Down

0 comments on commit abd742f

Please sign in to comment.