Parse the hex string into bytes (uint8_t or std::byte). Ignores whitespace. Returns nullopt on invalid input.
Declared in <util/strencodings.h>
template<typename Byte = std::byte>
std::optional<std::vector<Byte>>
TryParseHex(std::string_view str);
The decoded bytes, or std::nullopt if the input is not valid hex.
| Name | Description |
|---|---|
| str | The hex string to parse. |