All Projects → ademakov → RNG

ademakov / RNG

Licence: other
A simple state-of-the-art C++ random number generator

Programming Languages

C++
36643 projects - #6 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to RNG

randomgen
Numpy-compatible bit generators and add some random variate distributions missing from NumPy.
Stars: ✭ 82 (+331.58%)
Mutual labels:  prng, rng, random-number-generators, xoroshiro
secrets.clj
A library designed to generate cryptographically strong random numbers.
Stars: ✭ 64 (+236.84%)
Mutual labels:  random, prng, rng
prvhash
PRVHASH - Pseudo-Random-Value Hash. Hash functions, PRNG with unlimited period, randomness extractor. (Codename Gradilac/Градилак)
Stars: ✭ 194 (+921.05%)
Mutual labels:  random, prng, random-number-generators
random
The most random module on npm
Stars: ✭ 106 (+457.89%)
Mutual labels:  random, prng
datagen
Java lib that generates random data (numbers, strings, dates) - mostly to facilitate Randomized Testing.
Stars: ✭ 56 (+194.74%)
Mutual labels:  random, random-number-generators
lrng
Linux Random Number Generator
Stars: ✭ 57 (+200%)
Mutual labels:  random, rng
jsrand
A seeded pseudo-random number generator for JavaScript.
Stars: ✭ 19 (+0%)
Mutual labels:  random, prng
javascript-strong-password-generator
JavaScript Strong Password Generator: based on Jeff Atwood's Post "Password Rules Are Bullshit".
Stars: ✭ 21 (+10.53%)
Mutual labels:  random, random-number-generators
rocRAND
RAND library for HIP programming language
Stars: ✭ 68 (+257.89%)
Mutual labels:  random, rng
jRand
A Java library to generate random data for all sorts of things. Java random data faker
Stars: ✭ 27 (+42.11%)
Mutual labels:  random, random-number-generators
RandLib
🚀 A library designed to facilitate work with probability, statistics and stochastic calculus
Stars: ✭ 64 (+236.84%)
Mutual labels:  random, random-number-generators
flutter fortune wheel
Visualize random selections with Flutter widgets like the wheel of fortune.
Stars: ✭ 60 (+215.79%)
Mutual labels:  random
order-id
Unique order id generator
Stars: ✭ 46 (+142.11%)
Mutual labels:  random
EvenMoreModifiers
A mod for Terraria that adds a system for Modifiers that can apply to items giving various bonuses
Stars: ✭ 21 (+10.53%)
Mutual labels:  rng
SDETools
Matlab Toolbox for the Numerical Solution of Stochastic Differential Equations
Stars: ✭ 80 (+321.05%)
Mutual labels:  random
CryptoManana
An Advanced PHP Cryptography Framework
Stars: ✭ 15 (-21.05%)
Mutual labels:  random-number-generators
PokemonRNGGuides
A repository of Pokemon RNG abuse guides
Stars: ✭ 62 (+226.32%)
Mutual labels:  rng
Fluent-Random-Picker
Fluent Random Picker is a nice, performant, fluent way to pick random values. Probabilities can be specified, values can be weighted.
Stars: ✭ 26 (+36.84%)
Mutual labels:  random
random
Random data generator AKA faker
Stars: ✭ 14 (-26.32%)
Mutual labels:  random
fake-numbers
Generate fake, valid numbers. Check if a number is valid. Support a lot of different numbers: Credit card, EAN, ISBN, RTN, VIN, etc.
Stars: ✭ 51 (+168.42%)
Mutual labels:  random-number-generators

RNG

A simple C++ random number generator. It uses the latest and fastest Sebastiano Vigna's algorithm: xoroshiro128+.

It produces 64-bit integers. In my simple test it is more than five times faster than the mt19937_64 generator from the C++ standard library:

1000000000 rng128 calls
    0.2919 sec
1000000000 mt19937_64 calls
    1.59899 sec

As for the quality of the generator please refer to the results on Sebastiano Vigna's page.

In addition to the RNG itself there are two utility classes that produce 64-bit seeds for initializing the RNG. One extracts entropy from the system scheduler measuring it with x86 rdtsc instruction. The other uses std::random_device from the standard C++ library.

Sample code:

rng::tsc_seed seed;
rng::rng128 gen(seed());
std::cout << "a random number: " << gen() << "\n";

On Linux random_device_seed is faster than tsc_seed. But on macOS it is other way round.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].