1- using Spackle . Extensions ;
2- using System . Globalization ;
1+ using System . Globalization ;
32using System . Numerics ;
43using System . Security . Cryptography ;
54using System . Text ;
65
76namespace Spackle ;
87
8+ #pragma warning disable CA1716 // Identifiers should not match keywords
99/// <summary>
1010/// Provides random APIs backed by the security of <see cref="RandomNumberGenerator"/>.
1111/// </summary>
@@ -336,7 +336,7 @@ public int[] GetInt32Values(uint numberOfElements, Range range, ValueGeneration
336336 /// Returns a new random <see cref="int"/> value between 0 (inclusive)
337337 /// and <c>Int32.MaxValue</c> (exclusive).
338338 /// </returns>
339- public int Next ( ) =>
339+ public virtual int Next ( ) =>
340340 this . Next ( int . MaxValue ) ;
341341
342342 /// <summary>
@@ -348,7 +348,7 @@ public int Next() =>
348348 /// and <paramref name="maxValue"/> (exclusive).
349349 /// </returns>
350350 /// <exception cref="ArgumentException">Thrown if <paramref name="maxValue"/> is less than zero.</exception>
351- public int Next ( int maxValue )
351+ public virtual int Next ( int maxValue )
352352 {
353353 if ( maxValue < 0 )
354354 {
@@ -372,7 +372,7 @@ public int Next(int maxValue)
372372 /// <exception cref="ArgumentException">
373373 /// Thrown if <paramref name="maxValue"/> is less than <paramref name="minValue"/>.
374374 /// </exception>
375- public int Next ( int minValue , int maxValue )
375+ public virtual int Next ( int minValue , int maxValue )
376376 {
377377 if ( maxValue < minValue )
378378 {
@@ -409,18 +409,19 @@ public bool NextBoolean() =>
409409 /// Fills the given buffer with random bits.
410410 /// </summary>
411411 /// <param name="buffer">The buffer to populate.</param>
412- public void NextBytes ( byte [ ] buffer ) =>
412+ public virtual void NextBytes ( byte [ ] buffer ) =>
413413 this . Generator . GetBytes ( buffer ) ;
414414
415415 /// <summary>
416416 /// Gets a random <see cref="double"/> number.
417417 /// </summary>
418418 /// <returns>A <see cref="double"/> number.</returns>
419- public double NextDouble ( ) =>
419+ public virtual double NextDouble ( ) =>
420420 this . Next ( int . MaxValue ) * MaxInt32Inverse ;
421421
422422 /// <summary>
423423 /// Gets the underlying <see cref="RandomNumberGenerator"/>.
424424 /// </summary>
425425 public RandomNumberGenerator Generator { get ; }
426- }
426+ }
427+ #pragma warning restore CA1716 // Identifiers should not match keywords
0 commit comments