INNER CODE UNIT · C#
NextBytes
sdrapkin/SecurityDriven.Inferno · CryptoRandom.cs:254
public override void NextBytes(byte[] buffer) => NextBytes(buffer, 0, buffer.Length);
/// <summary>
/// Fills the specified byte array with a cryptographically strong random sequence of values.
/// </summary>
/// <param name="buffer">An array of bytes to contain random numbers.</param>
/// <param name="offset"></param>
/// <param name="count">Number of bytes to generate (must be lte buffer.Length).</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="buffer"/> is null.
/// </exception>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void NextBytes(byte[] buffer, int offset, int count)
{
new ArraySegment<byte>(buffer, offset, count); // bounds-validation happens here
if (count == 0) return;
NextBytesInternal(buffer, offset, count);
}//NextBytes()