ThreadLocalRng Class
A cryptographically secure thread local generator. All members in this type are thread-safe.
Namespace
RandN
Interfaces
Base Types
  • object
ThreadLocalRng
object
ICryptoRng
IRng

Syntax

public sealed class ThreadLocalRng : ICryptoRng, IRng

Properties

NameProperty TypeSummary
InstanceThreadLocalRng
The singleton instance of ThreadLocalRng.
static

Methods

NameReturn ValueSummary
Fill(Span<byte>)void
Completely fills the span with random bytes.
NextUInt32()uint
Returns the next 32 bits in the sequence as a UInt32.
NextUInt64()ulong
Returns the next 64 bits in the sequence as a UInt64.

Extension Methods

NameValueSummary
Sample<ThreadLocalRng, TDistribution, TResult>(TDistribution)TResult
Samples the distribution from rng.
Sample<ThreadLocalRng, TResult>(IDistribution<TResult>)TResult
Samples the distribution from rng.
ShuffleInPlace<ThreadLocalRng, T>(IList<T>)void
Shuffles a list using the in-place Fisher-Yates shuffling algorithm.