INNER CODE UNIT · C#
result
sdrapkin/SecurityDriven.Inferno · CryptoRandom.cs:67
result = GetRandomLong() & 0x7FFF_FFFF_FFFF_FFFF; // Mask away the sign bit so that we always return nonnegative integers
} while (result == long.MaxValue); // the range must be [0, long.MaxValue)
return result;
}//NextLong()
/// <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 64-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 long NextLong(long maxValue)