What is the best way to convert a variable length hex string e.g. \"01A1\" to a byte array containing that data.
\"01A1\"
i.e converting this:
st
You can use boost:
#include char bytes[60] = {0}; std::string hash = boost::algorithm::unhex(std::string("313233343536373839")); std::copy(hash.begin(), hash.end(), bytes);