aboutsummaryrefslogtreecommitdiff
path: root/src/util/strencodings.h
diff options
context:
space:
mode:
authorPieter Wuille <pieter@wuille.net>2022-04-04 13:52:06 -0400
committerMacroFake <falke.marco@gmail.com>2022-04-27 14:12:55 +0200
commit78f3ac51b7d073d12da6a3b9b7d80d91e04ce3a7 (patch)
tree60a138e61a7281fbba6391da8d0d73bd0c1f9fee /src/util/strencodings.h
parenta65931e3ce66d87b8f83d67ecdbb46f137e6a670 (diff)
Make DecodeBase{32,64} return optional instead of taking bool*
Diffstat (limited to 'src/util/strencodings.h')
-rw-r--r--src/util/strencodings.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/util/strencodings.h b/src/util/strencodings.h
index 5d85f0580b..27f6ec6e00 100644
--- a/src/util/strencodings.h
+++ b/src/util/strencodings.h
@@ -64,13 +64,13 @@ bool IsHex(std::string_view str);
* Return true if the string is a hex number, optionally prefixed with "0x"
*/
bool IsHexNumber(std::string_view str);
-std::vector<unsigned char> DecodeBase64(const char* p, bool* pf_invalid);
-std::vector<unsigned char> DecodeBase64(const std::string& str, bool* pf_invalid);
+std::optional<std::vector<unsigned char>> DecodeBase64(const char* p);
+std::optional<std::vector<unsigned char>> DecodeBase64(const std::string& str);
std::string EncodeBase64(Span<const unsigned char> input);
inline std::string EncodeBase64(Span<const std::byte> input) { return EncodeBase64(MakeUCharSpan(input)); }
inline std::string EncodeBase64(const std::string& str) { return EncodeBase64(MakeUCharSpan(str)); }
-std::vector<unsigned char> DecodeBase32(const char* p, bool* pf_invalid);
-std::vector<unsigned char> DecodeBase32(const std::string& str, bool* pf_invalid);
+std::optional<std::vector<unsigned char>> DecodeBase32(const char* p);
+std::optional<std::vector<unsigned char>> DecodeBase32(const std::string& str);
/**
* Base32 encode.