mirror of
https://github.com/AlexMacocian/SystemExtensions.git
synced 2026-07-24 03:56:27 +00:00
Extend CryptoRngProvider api
This commit is contained in:
@@ -25,6 +25,18 @@ namespace System.Rng
|
||||
{
|
||||
this.rngProvider.GetNonZeroBytes(data);
|
||||
}
|
||||
public byte[] GetBytes(int byteCount)
|
||||
{
|
||||
var bytes = new byte[byteCount];
|
||||
this.GetBytes(bytes);
|
||||
return bytes;
|
||||
}
|
||||
public byte[] GetNonZeroBytes(int byteCount)
|
||||
{
|
||||
var bytes = new byte[byteCount];
|
||||
this.GetNonZeroBytes(bytes);
|
||||
return bytes;
|
||||
}
|
||||
|
||||
private void Dispose(bool disposing)
|
||||
{
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
public interface ICryptoRngProvider
|
||||
{
|
||||
public void GetBytes(byte[] data);
|
||||
public byte[] GetBytes(int byteCount);
|
||||
public void GetNonZeroBytes(byte[] data);
|
||||
public byte[] GetNonZeroBytes(int byteCount);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user