Skip to content

Kg1511/Random_Gen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

random_gen

A small C++20 random-number generator library with multiple engines (LCG, PCG, Xoshiro, middle-square, Blum Blum Shub, and OS entropy) exposed as UniformRandomBitGenerators so you can use standard <random> distributions.

Recommended default

  • General-purpose: random_gen::pcg32

Basic usage

#include <random>
#include <random_gen/random_gen.hpp>

random_gen::pcg32 rng;
rng.seed(42);

std::uniform_int_distribution<int> dist(1, 6);
int roll = dist(rng);

Notes

  • middle_square32 and many LCGs are included for educational purposes and are not recommended when you need higher statistical quality.
  • blum_blum_shub64 here is intended for experimentation/learning; it is not a vetted cryptographic RNG implementation.

Building

mkdir build && cd build
cmake ..
cmake --build .

About

A lightweight C++20 random-number generator library implementing multiple engines (PCG, Xoshiro, LCG, Blum Blum Shub, and OS entropy) as standard UniformRandomBitGenerators for seamless <random> integration.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors