From c2a2445897af17adb56a32dcf111312763a575d4 Mon Sep 17 00:00:00 2001 From: Toni Uhlig Date: Mon, 2 Jul 2018 01:06:39 +0200 Subject: initial commit Signed-off-by: Toni Uhlig --- aoe2hd/src/utils.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 aoe2hd/src/utils.cpp (limited to 'aoe2hd/src/utils.cpp') diff --git a/aoe2hd/src/utils.cpp b/aoe2hd/src/utils.cpp new file mode 100755 index 0000000..7639ab7 --- /dev/null +++ b/aoe2hd/src/utils.cpp @@ -0,0 +1,19 @@ +#include "utils.h" + +#include +#include + + +namespace utils +{ +std::string convertBinToHexstr(const std::vector& bin) +{ + std::stringstream buffer; + for (auto byte : bin) + { + buffer << std::hex << std::setfill('0'); + buffer << std::setw(2) << static_cast(byte); + } + return buffer.str(); +} +} -- cgit v1.2.3