Skip to content

Commit daadfa8

Browse files
committed
Rename global RNG
1 parent 37ee57a commit daadfa8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/generate_random_strings.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include <ctime>
1111
#include <cstring>
1212

13-
static std::mt19937_64 rng(42);
13+
static std::mt19937_64 string_rng(42);
1414

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

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

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

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

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

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

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

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

0 commit comments

Comments
 (0)