summaryrefslogtreecommitdiff
path: root/aoe2hd/src/utils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'aoe2hd/src/utils.cpp')
-rwxr-xr-xaoe2hd/src/utils.cpp19
1 files changed, 19 insertions, 0 deletions
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 <sstream>
+#include <iomanip>
+
+
+namespace utils
+{
+std::string convertBinToHexstr(const std::vector<unsigned char>& bin)
+{
+ std::stringstream buffer;
+ for (auto byte : bin)
+ {
+ buffer << std::hex << std::setfill('0');
+ buffer << std::setw(2) << static_cast<unsigned>(byte);
+ }
+ return buffer.str();
+}
+}