Make ParseHex use string_view

This commit is contained in:
Pieter Wuille
2022-04-04 11:08:08 -04:00
committed by MacroFake
parent f58c1f1a44
commit c1d165a8c2
2 changed files with 12 additions and 21 deletions

View File

@@ -55,8 +55,7 @@ enum class ByteUnit : uint64_t {
* @return A new string without unsafe chars
*/
std::string SanitizeString(const std::string& str, int rule = SAFE_CHARS_DEFAULT);
std::vector<unsigned char> ParseHex(const char* psz);
std::vector<unsigned char> ParseHex(const std::string& str);
std::vector<unsigned char> ParseHex(std::string_view str);
signed char HexDigit(char c);
/* Returns true if each character in str is a hex character, and has an even
* number of hex digits.*/