| 30 | |
| 31 | template <typename CharType> |
| 32 | std::vector<CharType> hexStringToVec(const std::string &scripthex) { |
| 33 | std::vector<CharType> scriptBytes; |
| 34 | for (unsigned int i = 0; i < scripthex.size(); i += 2) { |
| 35 | std::string byteString = scripthex.substr(i, 2); |
| 36 | auto byte = static_cast<CharType>(strtol(byteString.c_str(), nullptr, 16)); |
| 37 | scriptBytes.push_back(byte); |
| 38 | } |
| 39 | return scriptBytes; |
| 40 | } |
| 41 | |
| 42 | #ifdef BLOCKSCI_FILE_PARSER |
| 43 | RawInput::RawInput(SafeMemReader &reader) : utxo{} { |