mirror of https://github.com/oxen-io/oxen-mq.git
Merge remote-tracking branch 'origin/dev' into stable
This commit is contained in:
commit
4f6dc35ea1
|
@ -17,7 +17,7 @@ cmake_minimum_required(VERSION 3.7)
|
|||
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.12 CACHE STRING "macOS deployment target (Apple clang only)")
|
||||
|
||||
project(liboxenmq
|
||||
VERSION 1.2.14
|
||||
VERSION 1.2.15
|
||||
LANGUAGES CXX C)
|
||||
|
||||
include(GNUInstallDirs)
|
||||
|
|
|
@ -460,11 +460,12 @@ std::ostream &operator<<(std::ostream &os, LogLevel lvl) {
|
|||
|
||||
std::string make_random_string(size_t size) {
|
||||
static thread_local std::mt19937_64 rng{std::random_device{}()};
|
||||
static thread_local std::uniform_int_distribution<char> dist{std::numeric_limits<char>::min(), std::numeric_limits<char>::max()};
|
||||
std::string rando;
|
||||
rando.reserve(size);
|
||||
for (size_t i = 0; i < size; i++)
|
||||
rando += dist(rng);
|
||||
while (rando.size() < size) {
|
||||
uint64_t x = rng();
|
||||
rando.append(reinterpret_cast<const char*>(&x), std::min<size_t>(size - rando.size(), 8));
|
||||
}
|
||||
return rando;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue