| Index: compiled/subscription/Subscription.cpp |
| diff --git a/compiled/subscription/Subscription.cpp b/compiled/subscription/Subscription.cpp |
| index e83819de4ed6fbda419e42ab57200e38efbbe530..51211e9cb2d915c8e671d4c2765ac753965cea94 100644 |
| --- a/compiled/subscription/Subscription.cpp |
| +++ b/compiled/subscription/Subscription.cpp |
| @@ -17,6 +17,7 @@ |
| #include <cstdio> |
| #include <cstdlib> |
| +#include <random> |
| #include "Subscription.h" |
| #include "DownloadableSubscription.h" |
| @@ -95,11 +96,11 @@ Subscription* Subscription::FromID(const String& id) |
| if (id.empty()) |
| { |
| // Generate a new random ID |
| - unsigned int seed = knownSubscriptions.size(); |
| + std::mt19937 gen(knownSubscriptions.size()); |
|
sergei
2018/02/06 13:07:29
It slightly differs from rand_r, what results in a
|
| OwnedString randomID(u"~user~000000"_str); |
| do |
| { |
| - int number = rand_r(&seed); |
| + int number = gen(); |
| for (int i = randomID.length() - 6; i < randomID.length(); i++) |
| { |
| randomID[i] = '0' + (number % 10); |