From f27b87d587bf23b9c80478ae3e060df786a411e0 Mon Sep 17 00:00:00 2001 From: heck Date: Thu, 30 Sep 2021 02:45:10 +0200 Subject: [PATCH] bin2hex - Add alternative --- src/std_utils.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/std_utils.cc b/src/std_utils.cc index e042ff3..7ced6c4 100644 --- a/src/std_utils.cc +++ b/src/std_utils.cc @@ -374,6 +374,14 @@ namespace pEp { ret.push_back((unsigned char)val_int); } return ret; + + // alternative way + // std::string extract; + // for (std::string::const_iterator pos = hex_str.begin(); pos < hex_str.end(); pos += 2) { + // extract.assign(pos, pos + 2); + // ret.push_back(std::stoi(extract, nullptr, 16)); + // } + // return ret; }