Skip to content

Commit

Permalink
Rename global RNG
Browse files Browse the repository at this point in the history
  • Loading branch information
mborland committed Oct 17, 2024
1 parent 37ee57a commit daadfa8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/generate_random_strings.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <ctime>
#include <cstring>

static std::mt19937_64 rng(42);
static std::mt19937_64 string_rng(42);

namespace boost {
namespace crypt {
Expand All @@ -28,7 +28,7 @@ inline void generate_random_string(char* str, std::size_t length)

for (std::size_t i = 0; i < length - 1; ++i)
{
const auto index = dist(rng);
const auto index = dist(string_rng);
str[i] = charset[index];
}

Expand All @@ -47,7 +47,7 @@ inline void generate_random_string(char16_t* str, std::size_t length)

for (std::size_t i = 0; i < length - 1; ++i)
{
const auto index = dist(rng);
const auto index = dist(string_rng);
str[i] = charset[index];
}

Expand All @@ -66,7 +66,7 @@ inline void generate_random_string(char32_t* str, std::size_t length)

for (std::size_t i = 0; i < length - 1; ++i)
{
const auto index = dist(rng);
const auto index = dist(string_rng);
str[i] = charset[index];
}

Expand All @@ -85,7 +85,7 @@ inline void generate_random_string(wchar_t* str, std::size_t length)

for (std::size_t i = 0; i < length - 1; ++i)
{
const auto index = dist(rng);
const auto index = dist(string_rng);
str[i] = charset[index];
}

Expand Down

0 comments on commit daadfa8

Please sign in to comment.