Sese Framework  2.3.0
A cross-platform framework
Loading...
Searching...
No Matches
sese::RandomUtil Class Reference

Random utility class. More...

#include <RandomUtil.h>

Public Member Functions

template<>
float next ()
 
template<>
double next ()
 
template<>
float next (float min, float max)
 
template<>
double next (double min, double max)
 

Static Public Member Functions

template<class RETURN_VALUE >
static RETURN_VALUE next ()
 
template<class RETURN_VALUE >
static RETURN_VALUE next (RETURN_VALUE min, RETURN_VALUE max)
 
static std::string nextString (size_t length, int required)
 
static uint64_t nextUnsignedInt64 ()
 
static std::random_device & getDevInstance () noexcept
 

Static Public Attributes

static constexpr int REQUIRED_UPPER_LETTER = 1
 
static constexpr int REQUIRED_LOWER_LETTER = 2
 
static constexpr int REQUIRED_DIGIT = 4
 
static constexpr int REQUIRED_SYMBOL = 8
 

Static Private Member Functions

static std::string nextString (size_t length, bool upper, bool lower, bool digit, bool symbol)
 

Static Private Attributes

static const std::string UPPER_LETTER_LIST = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
 
static const std::string LOWER_LETTER_LIST = "abcdefghijklmnopqrstuvwxyz"
 
static const std::string DIGIT_LIST = "01234567890"
 
static const std::string SYMBOL_LIST = "@#$&*()'\"%-+=/;:!,?._^[]{}|~\<>"
 
static std::random_device dev {}
 

Detailed Description

Random utility class.

Member Function Documentation

◆ getDevInstance()

std::random_device & sese::RandomUtil::getDevInstance ( )
staticnoexcept

Referenced by next(), and next().

◆ next() [1/6]

template<class RETURN_VALUE >
RETURN_VALUE sese::RandomUtil::next ( )
inlinestatic

◆ next() [2/6]

template<>
float sese::RandomUtil::next ( )
inline

References next().

◆ next() [3/6]

template<>
double sese::RandomUtil::next ( )
inline

References next().

◆ next() [4/6]

template<>
double sese::RandomUtil::next ( double min,
double max )
inline

References next().

◆ next() [5/6]

template<>
float sese::RandomUtil::next ( float min,
float max )
inline

References next().

◆ next() [6/6]

template<class RETURN_VALUE >
RETURN_VALUE sese::RandomUtil::next ( RETURN_VALUE min,
RETURN_VALUE max )
inlinestatic

References getDevInstance().

◆ nextString() [1/2]

std::string sese::RandomUtil::nextString ( size_t length,
bool upper,
bool lower,
bool digit,
bool symbol )
staticprivate

◆ nextString() [2/2]

std::string sese::RandomUtil::nextString ( size_t length,
int required )
static

References nextString().

Referenced by nextString().

◆ nextUnsignedInt64()

uint64_t sese::RandomUtil::nextUnsignedInt64 ( )
static

References dev.

Member Data Documentation

◆ dev

std::random_device sese::RandomUtil::dev {}
staticprivate

Referenced by nextUnsignedInt64().

◆ DIGIT_LIST

const std::string sese::RandomUtil::DIGIT_LIST = "01234567890"
staticprivate

◆ LOWER_LETTER_LIST

const std::string sese::RandomUtil::LOWER_LETTER_LIST = "abcdefghijklmnopqrstuvwxyz"
staticprivate

◆ REQUIRED_DIGIT

int sese::RandomUtil::REQUIRED_DIGIT = 4
staticconstexpr

◆ REQUIRED_LOWER_LETTER

int sese::RandomUtil::REQUIRED_LOWER_LETTER = 2
staticconstexpr

◆ REQUIRED_SYMBOL

int sese::RandomUtil::REQUIRED_SYMBOL = 8
staticconstexpr

◆ REQUIRED_UPPER_LETTER

int sese::RandomUtil::REQUIRED_UPPER_LETTER = 1
staticconstexpr

◆ SYMBOL_LIST

const std::string sese::RandomUtil::SYMBOL_LIST = "@#$&*()'\"%-+=/;:!,?._^[]{}|~\<>"
staticprivate

◆ UPPER_LETTER_LIST

const std::string sese::RandomUtil::UPPER_LETTER_LIST = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
staticprivate

The documentation for this class was generated from the following files: