Update to 13.0-beta1

This commit is contained in:
Pavel Stupnikov
2022-11-23 14:30:36 +04:00
parent 269352680c
commit be23283677
504 changed files with 14161 additions and 9678 deletions

View File

@@ -19,6 +19,7 @@
#include <stdarg.h>
#include <ctype.h> /* required for tolower() */
#include <sstream>
#include <iomanip>
#ifdef _MSC_VER
#include <errno.h> // required by vsnprintf implementation for MSVC
@@ -160,6 +161,23 @@ char *CDECL str_fmt(const char *str, ...)
return p;
}
/**
* Format a byte array into a continuous hex string.
* @param data Array to format
* @return Converted string.
*/
std::string FormatArrayAsHex(span<const byte> data)
{
std::ostringstream ss;
ss << std::uppercase << std::setfill('0') << std::setw(2) << std::hex;
for (auto b : data) {
ss << b;
}
return ss.str();
}
/**
* Scan the string for old values of SCC_ENCODED and fix it to
* it's new, static value.