Skip to content

Commit d3e8adf

Browse files
committed
util: remove c-string interfaces for DecodeBase58{Check}
1 parent ffad348 commit d3e8adf

File tree

2 files changed

+2
-15
lines changed

2 files changed

+2
-15
lines changed

src/base58.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ static const int8_t mapBase58[256] = {
3535
-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,
3636
};
3737

38-
bool DecodeBase58(const char* psz, std::vector<unsigned char>& vch, int max_ret_len)
38+
NODISCARD static bool DecodeBase58(const char* psz, std::vector<unsigned char>& vch, int max_ret_len)
3939
{
4040
// Skip leading spaces.
4141
while (*psz && IsSpace(*psz))
@@ -146,7 +146,7 @@ std::string EncodeBase58Check(const std::vector<unsigned char>& vchIn)
146146
return EncodeBase58(vch);
147147
}
148148

149-
bool DecodeBase58Check(const char* psz, std::vector<unsigned char>& vchRet, int max_ret_len)
149+
NODISCARD static bool DecodeBase58Check(const char* psz, std::vector<unsigned char>& vchRet, int max_ret_len)
150150
{
151151
if (!DecodeBase58(psz, vchRet, max_ret_len > std::numeric_limits<int>::max() - 4 ? std::numeric_limits<int>::max() : max_ret_len + 4) ||
152152
(vchRet.size() < 4)) {

src/base58.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,6 @@ std::string EncodeBase58(const unsigned char* pbegin, const unsigned char* pend)
3030
*/
3131
std::string EncodeBase58(const std::vector<unsigned char>& vch);
3232

33-
/**
34-
* Decode a base58-encoded string (psz) into a byte vector (vchRet).
35-
* return true if decoding is successful.
36-
* psz cannot be nullptr.
37-
*/
38-
NODISCARD bool DecodeBase58(const char* psz, std::vector<unsigned char>& vchRet, int max_ret_len);
39-
4033
/**
4134
* Decode a base58-encoded string (str) into a byte vector (vchRet).
4235
* return true if decoding is successful.
@@ -48,12 +41,6 @@ NODISCARD bool DecodeBase58(const std::string& str, std::vector<unsigned char>&
4841
*/
4942
std::string EncodeBase58Check(const std::vector<unsigned char>& vchIn);
5043

51-
/**
52-
* Decode a base58-encoded string (psz) that includes a checksum into a byte
53-
* vector (vchRet), return true if decoding is successful
54-
*/
55-
NODISCARD bool DecodeBase58Check(const char* psz, std::vector<unsigned char>& vchRet, int max_ret_len);
56-
5744
/**
5845
* Decode a base58-encoded string (str) that includes a checksum into a byte
5946
* vector (vchRet), return true if decoding is successful

0 commit comments

Comments
 (0)