BogaNet 1.4.0
Loading...
Searching...
No Matches
Static Public Member Functions | Properties | List of all members
BogaNet.TrueRandom.IntegerTRNG Class Referenceabstract

Generates true random integers in configurable intervals. More...

Inheritance diagram for BogaNet.TrueRandom.IntegerTRNG:
BogaNet.TrueRandom.BaseTRNG

Static Public Member Functions

static int CalcBits (int min, int max, int number=1)
 Calculates needed bits (from the quota) for generating random integers. NOTE: The calculated value is an approximation and will may differ from the real quota deducted from the server.
 
static List< int > Generate (int min, int max, int number=1, bool prng=false)
 Generates random integers.
 
static async Task< List< int > > GenerateAsync (int min, int max, int number=1, bool prng=false)
 Generates random integers asynchronously.
 
static System.Collections.Generic.List< int > GeneratePRNG (int min, int max, int number=1, int seed=0)
 Generates random integers with the C#-standard Pseudo-Random-Number-Generator.
 

Properties

static List< int > Result = [] [get]
 Returns the list of integers from the last generation.
 
- Properties inherited from BogaNet.TrueRandom.BaseTRNG
static int Seed [get]
 Returns a seed for the PRNG.
 

Additional Inherited Members

- Static Public Attributes inherited from BogaNet.TrueRandom.BaseTRNG
const string GENERATOR_URL = "https://www.random.org/"
 URL of the random number generator.
 
- Static Protected Attributes inherited from BogaNet.TrueRandom.BaseTRNG
static readonly Random _rnd = new()
 
static bool _isRunning
 

Detailed Description

Generates true random integers in configurable intervals.

Member Function Documentation

◆ CalcBits()

static int BogaNet.TrueRandom.IntegerTRNG.CalcBits ( int min,
int max,
int number = 1 )
static

Calculates needed bits (from the quota) for generating random integers. NOTE: The calculated value is an approximation and will may differ from the real quota deducted from the server.

Parameters
minSmallest possible number
maxBiggest possible number
numberHow many numbers (default: 1, optional)
Returns
Needed bits for generating the integers.

◆ Generate()

static List< int > BogaNet.TrueRandom.IntegerTRNG.Generate ( int min,
int max,
int number = 1,
bool prng = false )
static

Generates random integers.

Parameters
minSmallest possible number (range: -1'000'000'000 - 1'000'000'000)
maxBiggest possible number (range: -1'000'000'000 - 1'000'000'000)
numberHow many numbers you want to generate (optional, range: 1 - 10'000, default: 1)
prngUse Pseudo-Random-Number-Generator (optional, default: false)
Returns
List with the generated integers.
Exceptions
Exception

◆ GenerateAsync()

static async Task< List< int > > BogaNet.TrueRandom.IntegerTRNG.GenerateAsync ( int min,
int max,
int number = 1,
bool prng = false )
static

Generates random integers asynchronously.

Parameters
minSmallest possible number (range: -1'000'000'000 - 1'000'000'000)
maxBiggest possible number (range: -1'000'000'000 - 1'000'000'000)
numberHow many numbers you want to generate (optional, range: 1 - 10'000, default: 1)
prngUse Pseudo-Random-Number-Generator (optional, default: false)
Returns
List with the generated integers.
Exceptions
Exception

◆ GeneratePRNG()

static System.Collections.Generic.List< int > BogaNet.TrueRandom.IntegerTRNG.GeneratePRNG ( int min,
int max,
int number = 1,
int seed = 0 )
static

Generates random integers with the C#-standard Pseudo-Random-Number-Generator.

Parameters
minSmallest possible number
maxBiggest possible number
numberHow many numbers you want to generate (optional, default: 1)
seedSeed for the PRNG (optional, default: 0 (=standard))
Returns
List with the generated integers.

Property Documentation

◆ Result

List<int> BogaNet.TrueRandom.IntegerTRNG.Result = []
staticget

Returns the list of integers from the last generation.

Returns
List of integers from the last generation.

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