Click or drag to resize

CryptoRandom Class

RNGCryptoServiceProvider based random; very slow but cryptographically safe
Inheritance Hierarchy

Namespace:  Internal.Lidgren.Network
Assembly:  NeoAxis.Core (in NeoAxis.Core.dll) Version: 2024.1.1.0 (2024.1.1.0)
Syntax
C#
public class CryptoRandom : NetRandom

The CryptoRandom type exposes the following members.

Constructors
  NameDescription
Public methodCryptoRandom
Initializes a new instance of the CryptoRandom class
Top
Methods
  NameDescription
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodInitialize
Seed in CryptoRandom does not create deterministic sequences
(Overrides NetRandomInitialize(UInt32).)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodNext
Generates a random value that is greater or equal than 0 and less than Int32.MaxValue
(Inherited from NetRandom.)
Public methodNext(Int32)
Returns a random value is greater or equal than 0 and less than maxValue
(Inherited from NetRandom.)
Public methodNext(Int32, Int32)
Returns a random value is greater or equal than minValue and less than maxValue
(Inherited from NetRandom.)
Public methodNextBool
Returns true or false, randomly
(Inherited from NetRandom.)
Public methodNextBytes(Byte)
Fill the specified buffer with random values
(Overrides NetRandomNextBytes(Byte).)
Public methodNextBytes(Byte, Int32, Int32)
Fills all bytes from offset to offset + length in buffer with random values
(Overrides NetRandomNextBytes(Byte, Int32, Int32).)
Public methodNextDouble
Returns random value larger or equal to 0.0 and less than 1.0
(Inherited from NetRandom.)
Public methodNextInt32
Generates a random value greater or equal than 0 and less or equal than Int32.MaxValue (inclusively)
(Inherited from NetRandom.)
Public methodNextSingle
Returns random value is greater or equal than 0.0f and less than 1.0f
(Inherited from NetRandom.)
Public methodNextUInt32
Generates a random value from UInt32.MinValue to UInt32.MaxValue, inclusively
(Overrides NetRandomNextUInt32.)
Public methodNextUInt64
Generates a random value between UInt64.MinValue to UInt64.MaxValue
(Inherited from NetRandom.)
Protected methodSample
Returns random value is greater or equal than 0.0 and less than 1.0
(Inherited from NetRandom.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Fields
  NameDescription
Public fieldStatic memberInstance
Global instance of CryptoRandom
Top
Extension Methods
See Also