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

Generates true random strings of various length and character compositions. More...

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

Static Public Member Functions

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

Properties

static List< string > Result = [] [get]
 Returns the list of strings 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 strings of various length and character compositions.

Member Function Documentation

◆ CalcBits()

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

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

Parameters
lengthLength of the strings
numberHow many strings (default: 1, optional)
Returns
Needed bits for generating the strings.

◆ Generate()

static List< string > BogaNet.TrueRandom.StringTRNG.Generate ( int length,
int number = 1,
bool digits = true,
bool upper = true,
bool lower = true,
bool unique = false,
bool prng = false )
static

Generates random strings.

Parameters
lengthHow long the strings should be (range: 1 - 20)
numberHow many strings you want to generate (optional, range: 1 - 10'000, default: 1)
digitsAllow digits (0-9) (optional, default: true)
upperAllow uppercase letters (optional, default: true)
lowerAllow lowercase letters (optional, default: true)
uniqueString should be unique (optional, default: false)
prngUse Pseudo-Random-Number-Generator (optional, default: false)

◆ GenerateAsync()

static async Task< List< string > > BogaNet.TrueRandom.StringTRNG.GenerateAsync ( int length,
int number = 1,
bool digits = true,
bool upper = true,
bool lower = true,
bool unique = false,
bool prng = false )
static

Generates random strings asynchronously.

Parameters
lengthHow long the strings should be (range: 1 - 20)
numberHow many strings you want to generate (optional, range: 1 - 10'000, default: 1)
digitsAllow digits (0-9) (optional, default: true)
upperAllow uppercase letters (optional, default: true)
lowerAllow lowercase letters (optional, default: true)
uniqueString should be unique (optional, default: false)
prngUse Pseudo-Random-Number-Generator (optional, default: false)

◆ GeneratePRNG()

static List< string > BogaNet.TrueRandom.StringTRNG.GeneratePRNG ( int length,
int number = 1,
bool digits = true,
bool upper = true,
bool lower = true,
bool unique = false,
int seed = 0 )
static

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

Parameters
lengthHow long the strings should be
numberHow many strings you want to generate (optional, default: 1)
digitsAllow digits (0-9) (optional, default: true)
upperAllow uppercase (A-Z) letters (optional, default: true)
lowerAllow lowercase (a-z) letters (optional, default: true)
uniqueString should be unique (optional, default: false)
seedSeed for the PRNG (optional, default: 0 (=standard))
Returns
List with the generated strings.

Property Documentation

◆ Result

List<string> BogaNet.TrueRandom.StringTRNG.Result = []
staticget

Returns the list of strings from the last generation.

Returns
List of strings from the last generation.

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