szaszm commented on a change in pull request #1249:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1249#discussion_r800716297



##########
File path: libminifi/include/utils/StringUtils.h
##########
@@ -423,46 +416,37 @@ class StringUtils {
    * @param base64_length the length of base64
    * @return true on success
    */
-  static bool from_base64(uint8_t* data, size_t* data_length, const char* 
base64, size_t base64_length);
+  static bool from_base64(std::byte* data, size_t* data_length, 
std::string_view base64);
 
   /**
    * Base64 decodes a string
    * @param base64 the Base64 encoded string
    * @param base64_length the length of base64
    * @return the vector containing the decoded bytes
    */
-  static std::vector<uint8_t> from_base64(const char* base64, size_t 
base64_length);
-
-  /**
-   * Base64 decodes a string
-   * @param base64 the Base64 encoded string
-   * @return the decoded string
-   */
-  inline static std::string from_base64(const std::string& base64) {
-    auto data = from_base64(base64.data(), base64.length());
-    return std::string(reinterpret_cast<char*>(data.data()), data.size());
+  static std::vector<std::byte> from_base64(std::string_view base64);
+  static std::string from_base64(std::string_view base64, as_string_tag_t) {

Review comment:
       I failed to notice this similarity while changing them. Thanks for 
pointing it out. I made them similar again in 
[04e00fa](https://github.com/apache/nifi-minifi-cpp/pull/1249/commits/04e00fa03c4409b2aabccdf1292698337b70e895).




-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to