Cbeam
Loading...
Searching...
No Matches
generators.hpp File Reference
#include <random>
#include <string>
Include dependency graph for generators.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  cbeam
 The root namespace for the Cbeam library. This namespace unifies cross-platform utilities for concurrency, memory management, file handling, logging, serialization, and more. Its purpose is to provide a cohesive collection of modern C++ components that address common system-level and application-level tasks, while promoting thread-safety, interprocess communication, and stable resource handling across varied platform APIs.
 
namespace  cbeam::random
 Collects random number generation tools for multithreaded environments. It includes a default thread-local generator and utilities to produce random integers, uniform distributions, or random strings. This promotes convenient generation of secure or test-oriented random values without external dependencies.
 

Functions

std::mt19937 & cbeam::random::default_generator ()
 Returns a reference to a thread-local std::mt19937 random number generator.
 
std::size_t cbeam::random::random_number (const std::size_t n, std::mt19937 &gen=default_generator())
 Returns a random number in the range [0, n-1].
 
std::string cbeam::random::random_string (std::string::size_type length, std::mt19937 &gen=default_generator())
 Generates a random string of specified length.