Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
class System.​Security.​Cryptography.​RandomNumberGenerator
Assembly: System.Security.Cryptography
Inheritance: object → RandomNumberGenerator
Provides functionality for generating random values.
Methods
public
void
Dispose​()
When overridden in a derived class, releases all resources used by the current instance of the <see cref="T:System.Security.Cryptography.RandomNumberGenerator" /> class.
protected
void
Dispose​(bool disposing)
disposing
<see langword="true" /> to release both managed and unmanaged resources; <see langword="false" /> to release only unmanaged resources.
When overridden in a derived class, releases the unmanaged resources used by the <see cref="T:System.Security.Cryptography.RandomNumberGenerator" /> and optionally releases the managed resources.
public
void
GetBytes​(byte[] data)
data
The array to fill with cryptographically strong random bytes.
When overridden in a derived class, fills an array of bytes with a cryptographically strong random sequence of values.
public
void
GetBytes​(byte[] data,
int offset,
int count)
data
The array to fill with cryptographically strong random bytes.
offset
The index of the array to start the fill operation.
count
The number of bytes to fill.
Fills the specified byte array with a cryptographically strong random sequence of values.
public
void
GetNonZeroBytes​(byte[] data)
data
The array to fill with cryptographically strong random nonzero bytes.
When overridden in a derived class, fills an array of bytes with a cryptographically strong random sequence of nonzero values.
public
bool
Equals​(object obj)
Inherited from object
protected
void
Finalize​()
Inherited from object
public
int
GetHashCode​()
Inherited from object
protected
object
MemberwiseClone​()
Inherited from object
public
string
ToString​()
Inherited from object