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

Generates true random byte-arrays in configurable intervals. More...

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

Static Public Member Functions

static int CalcBits (int length, int number=1)
 Calculates needed bits (from the quota) for generating random byte-arrays. NOTE: The calculated value is an approximation and will may differ from the real quota deducted from the server.
 
static List< byte[]> Generate (int length, int number=1, bool prng=false)
 Generates random byte-arrays.
 
static async Task< List< byte[]> > GenerateAsync (int length, int number=1, bool prng=false)
 Generates random byte-arrays asynchronously.
 
static List< byte[]> GeneratePRNG (int length, int number=1)
 Generates random byte-arrays.
 

Properties

static List< byte[]> Result = [] [get]
 Returns the list of byte-arrays 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 byte-arrays in configurable intervals.

Member Function Documentation

◆ CalcBits()

static int BogaNet.TrueRandom.BytesTRNG.CalcBits ( int length,
int number = 1 )
static

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

Parameters
lengthLength of the byte-array
numberHow many byte-arrays (default: 1, optional)
Returns
Needed bits for generating the byte-arrays.

◆ Generate()

static List< byte[]> BogaNet.TrueRandom.BytesTRNG.Generate ( int length,
int number = 1,
bool prng = false )
static

Generates random byte-arrays.

Parameters
lengthDefines how many bytes the byte-arrays contains (range: 1 - 20)
numberHow many byte-arrays to generate (optional, range: 1 - 10'000, default: 1)
prngUse Pseudo-Random-Number-Generator (optional, default: false)
Returns
List with the generated byte-arrays.

◆ GenerateAsync()

static async Task< List< byte[]> > BogaNet.TrueRandom.BytesTRNG.GenerateAsync ( int length,
int number = 1,
bool prng = false )
static

Generates random byte-arrays asynchronously.

Parameters
lengthDefines how many bytes the byte-arrays contains (range: 1 - 20)
numberHow many byte-arrays to generate (optional, range: 1 - 10'000, default: 1)
prngUse Pseudo-Random-Number-Generator (optional, default: false)
Returns
List with the generated byte-arrays.

◆ GeneratePRNG()

static List< byte[]> BogaNet.TrueRandom.BytesTRNG.GeneratePRNG ( int length,
int number = 1 )
static

Generates random byte-arrays.

Parameters
lengthDefines how many bytes the byte-arrays contains
numberHow many byte-arrays to generate (optional, default: 1)
Returns
List with the generated byte-arrays.

Property Documentation

◆ Result

List<byte[]> BogaNet.TrueRandom.BytesTRNG.Result = []
staticget

Returns the list of byte-arrays from the last generation.

Returns
List of byte-arrays from the last generation.

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