using System; namespace CKS.FormsBasedAuthentication.HIP { /// Base class for IHttpHandlers serving content for HipChallenge-derived controls. public abstract class BaseHipChallengeHandler { /// Random number generator used to create the HIP. private RandomNumbers _rand = new RandomNumbers(); /// Gets a random non-negative integer less than max. /// The upper-bound for the random number. /// The generated random number. protected int NextRandom(int max) { return _rand.Next(max); } /// Gets a random number between min and max, inclusive. /// The minimum possible value. /// The maximum possible value. /// The randomly generated number. protected int NextRandom(int min, int max) { return _rand.Next(min, max); } /// Gets a randomly generated double between 0.0 and 1.1. /// The random number. protected double NextRandomDouble() { return _rand.NextDouble(); } } }