Show / Hide Table of Contents

Class Pseudorandom

Provides thread-safe pseudorandom number generation using cryptographically secure seeds.

Inheritance
object
Pseudorandom
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: EarleyParser
Assembly: EarleyParser.dll
Syntax
public static class Pseudorandom
Remarks

This class uses a combination of cryptographic random number generation for seeding and thread-local storage to ensure thread safety. Each thread gets its own Random instance initialized with a cryptographically secure seed.

Methods

| Edit this page View Source

NextDouble()

Returns a random floating-point number that is greater than or equal to 0.0, and less than 1.0.

Declaration
public static double NextDouble()
Returns
Type Description
double

A double-precision floating point number that is greater than or equal to 0.0, and less than 1.0.

| Edit this page View Source

NextInt()

Returns a non-negative random integer.

Declaration
public static int NextInt()
Returns
Type Description
int

A 32-bit signed integer that is greater than or equal to 0 and less than MaxValue.

| Edit this page View Source

NextInt(int)

Returns a non-negative random integer that is less than the specified maximum.

Declaration
public static int NextInt(int range)
Parameters
Type Name Description
int range

The exclusive upper bound of the random number to be generated.

Returns
Type Description
int

A random integer that is greater than or equal to 0, and less than range.

  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX