diff --git a/src/util/strencodings.h b/src/util/strencodings.h --- a/src/util/strencodings.h +++ b/src/util/strencodings.h @@ -53,12 +53,12 @@ * Return true if the string is a hex number, optionally prefixed with "0x" */ bool IsHexNumber(const std::string &str); -std::vector DecodeBase64(const char *p, bool *pfInvalid = nullptr); -std::string DecodeBase64(const std::string &str); +std::vector DecodeBase64(const char *p, bool *pf_invalid = nullptr); +std::string DecodeBase64(const std::string &str, bool *pf_invalid = nullptr); std::string EncodeBase64(const uint8_t *pch, size_t len); std::string EncodeBase64(const std::string &str); -std::vector DecodeBase32(const char *p, bool *pfInvalid = nullptr); -std::string DecodeBase32(const std::string &str); +std::vector DecodeBase32(const char *p, bool *pf_invalid = nullptr); +std::string DecodeBase32(const std::string &str, bool *pf_invalid = nullptr); std::string EncodeBase32(const uint8_t *pch, size_t len); std::string EncodeBase32(const std::string &str); diff --git a/src/util/strencodings.cpp b/src/util/strencodings.cpp --- a/src/util/strencodings.cpp +++ b/src/util/strencodings.cpp @@ -150,7 +150,7 @@ return EncodeBase64((const uint8_t *)str.c_str(), str.size()); } -std::vector DecodeBase64(const char *p, bool *pfInvalid) { +std::vector DecodeBase64(const char *p, bool *pf_invalid) { static const int decode64_table[256] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, @@ -194,15 +194,15 @@ ++p; } valid = valid && (p - e) % 4 == 0 && p - q < 4; - if (pfInvalid) { - *pfInvalid = !valid; + if (pf_invalid) { + *pf_invalid = !valid; } return ret; } -std::string DecodeBase64(const std::string &str) { - std::vector vchRet = DecodeBase64(str.c_str()); +std::string DecodeBase64(const std::string &str, bool *pf_invalid) { + std::vector vchRet = DecodeBase64(str.c_str(), pf_invalid); return std::string((const char *)vchRet.data(), vchRet.size()); } @@ -222,7 +222,7 @@ return EncodeBase32((const uint8_t *)str.c_str(), str.size()); } -std::vector DecodeBase32(const char *p, bool *pfInvalid) { +std::vector DecodeBase32(const char *p, bool *pf_invalid) { static const int decode32_table[256] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, @@ -266,15 +266,15 @@ ++p; } valid = valid && (p - e) % 8 == 0 && p - q < 8; - if (pfInvalid) { - *pfInvalid = !valid; + if (pf_invalid) { + *pf_invalid = !valid; } return ret; } -std::string DecodeBase32(const std::string &str) { - std::vector vchRet = DecodeBase32(str.c_str()); +std::string DecodeBase32(const std::string &str, bool *pf_invalid) { + std::vector vchRet = DecodeBase32(str.c_str(), pf_invalid); return std::string((const char *)vchRet.data(), vchRet.size()); }