Utility singleton component to generate random values of various types, including number, string, UUID and etc.
More...
#include <random_generator.h>
|
static string | GenerateAlphanumeric (size_t min_length, size_t max_length) |
| Generates a random alphanumeric string, string length in range [min_length, max_length](max also inclusive). More...
|
|
static int64_t | GenerateNumber (int64_t min, int64_t max) |
| Generates a random number, in range of [min, max](max also inclusive). More...
|
|
static Uuid | GenerateUuid () |
| Generates a random UUID, using boost::uuids::random_generator. More...
|
|
Thread-safe using boost::mutex.
◆ GenerateAlphanumeric()
static string fun::RandomGenerator::GenerateAlphanumeric |
( |
size_t |
min_length, |
|
|
size_t |
max_length |
|
) |
| |
|
static |
- Parameters
-
min_length | Min value of string length(inclusive). |
max_length | Max value of string length(inclusive). |
- Returns
- A newly generated random alphanumeric string.
◆ GenerateNumber()
static int64_t fun::RandomGenerator::GenerateNumber |
( |
int64_t |
min, |
|
|
int64_t |
max |
|
) |
| |
|
static |
- Parameters
-
min | Min value(inclusive). |
max | Max value(inclusive). |
- Returns
- A newly generated random number.
◆ GenerateUuid()
static Uuid fun::RandomGenerator::GenerateUuid |
( |
| ) |
|
|
static |
- Returns
- A newly generated random UUID.