INNER CODE UNIT · C#

result

sdrapkin/SecurityDriven.Inferno · CryptoRandom.cs:149

				result = GetRandomInt() & 0x7FFF_FFFF; // Mask away the sign bit so that we always return nonnegative integers

			} while (result == int.MaxValue); // the range must be [0, int.MaxValue)
			return result;
		}//Next()

		/// <summary>
		/// Returns a nonnegative random number less than the specified maximum.
		/// </summary>
		/// <param name="maxValue">The exclusive upper bound of the random number to be generated. <paramref name="maxValue"/> must be greater than or equal to zero.</param>
		/// <returns>
		/// A 32-bit signed integer greater than or equal to zero, and less than <paramref name="maxValue"/>; that is, the range of return values ordinarily includes zero but not <paramref name="maxValue"/>. However, if <paramref name="maxValue"/> equals zero, <paramref name="maxValue"/> is returned.
		/// </returns>
		/// <exception cref="T:System.ArgumentOutOfRangeException">
		///     <paramref name="maxValue"/> is less than zero.
		/// </exception>
		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public override int Next(int maxValue)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…