Cryptographically strong RNG, uses /dev/urandom. More...
#include <RND.h>
Public Member Functions | |
| URand (const size_t buf_size=128) | |
| Default constructor. More... | |
| virtual u32 | Get_u32 () |
| Provides random u32 values. | |
Public Member Functions inherited from RC::BaseRND | |
| BaseRND () | |
| Default constructor. | |
| u32 | operator() () |
| Equivalent to Get_u32(). | |
| i32 | Get_i32 () |
| Provides random i32 values. | |
| u64 | Get_u64 () |
| Provides random u64 values. | |
| i64 | Get_i64 () |
| Provides random i64 values. | |
| f32 | Get_f32 () |
| Provides a random f32 in the range [0,1). | |
| f64 | Get_f64 () |
| Provides a random f64 in the range [0,1). | |
| u8 | Get_u8 () |
| Provides random u8 values. | |
| i8 | Get_i8 () |
| Provides random i8 values. | |
| char | Get_char () |
| Provides random char values. | |
| u16 | Get_u16 () |
| Provides random u16 values. | |
| i16 | Get_i16 () |
| Provides random i16 values. | |
| void | Get (u8 &x) |
| Overloaded function to extract type u8 from this class. More... | |
| void | Get (i8 &x) |
| Overloaded function to extract type i8 from this class. More... | |
| void | Get (char &x) |
| Overloaded function to extract type char from this class. More... | |
| void | Get (u16 &x) |
| Overloaded function to extract type u16 from this class. More... | |
| void | Get (i16 &x) |
| Overloaded function to extract type i16 from this class. More... | |
| void | Get (u32 &x) |
| Overloaded function to extract type u32 from this class. More... | |
| void | Get (i32 &x) |
| Overloaded function to extract type i32 from this class. More... | |
| void | Get (u64 &x) |
| Overloaded function to extract type u64 from this class. More... | |
| void | Get (i64 &x) |
| Overloaded function to extract type i64 from this class. More... | |
| void | Get (f32 &x) |
| Overloaded function to extract type f32 from this class. More... | |
| void | Get (f64 &x) |
| Overloaded function to extract type f64 from this class. More... | |
| bool | GetProb (f64 probability) |
| Returns true with probability, which should be in the range [0,1]. More... | |
| bool | GetProb (f32 probability) |
| Returns true with probability, which should be in the range [0,1]. More... | |
| u64 | GetRange (u64 range) |
| Returns [0,range) More... | |
| i64 | GetRange (i64 range) |
| Like GetRange() but for i64. | |
| u32 | GetRange (u32 range) |
| Like GetRange() but for i32. More... | |
| i32 | GetRange (i32 range) |
| Like GetRange() but for i32. | |
| template<class T > | |
| T | GetRange (T low, T high) |
| Provides a random integer value in the range [low,high]. | |
| f64 | GetFRange (f64 low, f64 high) |
| Provides a random float in the range [low,high). | |
| template<class T > | |
| void | Fill (Data1D< T > &data) |
| For any supported data type, fills the Data1D with random values. | |
| template<class T > | |
| T | GetFrom (Data1D< T > &data) |
| Returns a random element from the Data1D. | |
Additional Inherited Members | |
Public Types inherited from RC::BaseRND | |
| typedef u32 | result_type |
| For UniformRandomNumberGenerator compliance. | |
Static Public Member Functions inherited from RC::BaseRND | |
| constexpr static u32 | min () |
| Returns 0 for UniformRandomNumberGenerator compliance. | |
| constexpr static u32 | max () |
| Returns u32 max for UniformRandomNumberGenerator compliance. | |
| static u64 | GetEntropy () |
| Provides 64 bits of environmental entropy. More... | |
Cryptographically strong RNG, uses /dev/urandom.
The interface is identical to RND.h except there are no seed functions.
|
inline |
Default constructor.
| buf_size | The number of u32 values to read at a time. |
1.9.1