lishuxu commented on code in PR #646:
URL: https://github.com/apache/iceberg-cpp/pull/646#discussion_r3328854438
##########
src/iceberg/util/transform_util.h:
##########
@@ -139,6 +140,19 @@ class ICEBERG_EXPORT TransformUtil {
/// \brief Base64 encode a string
static std::string Base64Encode(std::string_view str_to_encode);
+
+ /// \brief Base64 decode a string (standard alphabet: +/).
+ ///
+ /// Handles optional padding ('=').
+ /// \return Decoded string, or an error if the input contains invalid
characters.
+ static Result<std::string> Base64Decode(std::string_view encoded);
+
+ /// \brief Base64url decode a string (URL-safe alphabet: -_).
+ ///
+ /// Handles optional padding ('='). This variant uses '-' and '_' instead of
+ /// '+' and '/' per RFC 4648 ยง5.
+ /// \return Decoded string, or an error if the input contains invalid
characters.
+ static Result<std::string> Base64UrlDecode(std::string_view encoded);
Review Comment:
Added Base64::UrlEncode for parity. It also replaces the hand-rolled
base64url encoder in auth_manager_test.cc.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]