Leosac  0.8.0
Open Source Access Control
Random Class Reference

#include <Random.hpp>

+ Collaboration diagram for Random:

Static Public Member Functions

static ByteVector GetBytes (size_t n)
 Generate n random bytes. More...
 
static std::string GetASCII (size_t n)
 Return a random ASCII string. More...
 

Static Private Attributes

static std::mutex mutex_
 OpenSSL's random number generation is not thread-safe. More...
 

Detailed Description

Definition at line 28 of file Random.hpp.

Member Function Documentation

◆ GetASCII()

std::string Random::GetASCII ( size_t  n)
static

Return a random ASCII string.

Definition at line 41 of file Random.cpp.

◆ GetBytes()

ByteVector Random::GetBytes ( size_t  n)
static

Generate n random bytes.

Parameters
nSize of random data.
Returns
Random data.

Definition at line 29 of file Random.cpp.

Member Data Documentation

◆ mutex_

std::mutex Random::mutex_
staticprivate

OpenSSL's random number generation is not thread-safe.

Definition at line 48 of file Random.hpp.


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