aboutsummaryrefslogtreecommitdiff
path: root/src/base58.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/base58.h')
-rw-r--r--src/base58.h28
1 files changed, 5 insertions, 23 deletions
diff --git a/src/base58.h b/src/base58.h
index 042ad671d3..468c3e2589 100644
--- a/src/base58.h
+++ b/src/base58.h
@@ -15,27 +15,15 @@
#define BITCOIN_BASE58_H
#include <attributes.h>
+#include <span.h>
#include <string>
#include <vector>
/**
- * Encode a byte sequence as a base58-encoded string.
- * pbegin and pend cannot be nullptr, unless both are.
+ * Encode a byte span as a base58-encoded string
*/
-std::string EncodeBase58(const unsigned char* pbegin, const unsigned char* pend);
-
-/**
- * Encode a byte vector as a base58-encoded string
- */
-std::string EncodeBase58(const std::vector<unsigned char>& vch);
-
-/**
- * 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<unsigned char>& vchRet, int max_ret_len);
+std::string EncodeBase58(Span<const unsigned char> input);
/**
* Decode a base58-encoded string (str) into a byte vector (vchRet).
@@ -44,15 +32,9 @@ NODISCARD bool DecodeBase58(const char* psz, std::vector<unsigned char>& vchRet,
NODISCARD bool DecodeBase58(const std::string& str, std::vector<unsigned char>& vchRet, int max_ret_len);
/**
- * Encode a byte vector into a base58-encoded string, including checksum
- */
-std::string EncodeBase58Check(const std::vector<unsigned char>& vchIn);
-
-/**
- * Decode a base58-encoded string (psz) that includes a checksum into a byte
- * vector (vchRet), return true if decoding is successful
+ * Encode a byte span into a base58-encoded string, including checksum
*/
-NODISCARD bool DecodeBase58Check(const char* psz, std::vector<unsigned char>& vchRet, int max_ret_len);
+std::string EncodeBase58Check(Span<const unsigned char> input);
/**
* Decode a base58-encoded string (str) that includes a checksum into a byte