diff --git a/src/base58.h b/src/base58.h --- a/src/base58.h +++ b/src/base58.h @@ -26,14 +26,6 @@ */ std::string EncodeBase58(Span input); -/** - * Decode a base58-encoded string (psz) into a byte vector (vchRet). - * return true if decoding is successful. - * psz cannot be nullptr. - */ -[[nodiscard]] bool DecodeBase58(const char *psz, std::vector &vchRet, - int max_ret_len); - /** * Decode a base58-encoded string (str) into a byte vector (vchRet). * return true if decoding is successful. @@ -46,14 +38,6 @@ */ std::string EncodeBase58Check(Span input); -/** - * Decode a base58-encoded string (psz) that includes a checksum into a byte - * vector (vchRet), return true if decoding is successful - */ -[[nodiscard]] bool DecodeBase58Check(const char *psz, - std::vector &vchRet, - int max_ret_len); - /** * Decode a base58-encoded string (str) that includes a checksum into a byte * vector (vchRet), return true if decoding is successful diff --git a/src/base58.cpp b/src/base58.cpp --- a/src/base58.cpp +++ b/src/base58.cpp @@ -34,7 +34,8 @@ -1, -1, -1, -1, -1, -1, -1, -1, -1, }; -bool DecodeBase58(const char *psz, std::vector &vch, int max_ret_len) { +[[nodiscard]] static bool +DecodeBase58(const char *psz, std::vector &vch, int max_ret_len) { // Skip leading spaces. while (*psz && IsSpace(*psz)) { psz++; @@ -156,8 +157,9 @@ return EncodeBase58(vch); } -bool DecodeBase58Check(const char *psz, std::vector &vchRet, - int max_ret_len) { +[[nodiscard]] static bool DecodeBase58Check(const char *psz, + std::vector &vchRet, + int max_ret_len) { if (!DecodeBase58(psz, vchRet, max_ret_len > std::numeric_limits::max() - 4 ? std::numeric_limits::max()