// Copyright (c) Microsoft Corporation and Contributors. // Licensed under the MIT License. #include "pch.h" std::vector hexStringToBytes(const std::string& hex) { std::vector bytes; for (unsigned int i = 0; i < hex.length(); i += 2) { std::string byteString = hex.substr(i, 2); uint8_t byte = (uint8_t)strtol(byteString.c_str(), nullptr, 16); bytes.push_back(byte); } return bytes; }