If has access to CryptoPP
Readable Hex String to unsigned char
std::string& hexed = "C23412341324AB";
uint8_t buffer[64] = {0};
StringSource ssk(hexed, true,
new HexDecoder(new ArraySink(buffer,sizeof(buffer))));
And back
std::string hexed;
uint8_t val[32] = {0};
StringSource ss(val, sizeof(val), true,new HexEncoder(new StringSink(hexed));
// val == buffer