/// <summary>
        /// Generates next random UInt64 between 0 and maxValue .
        /// </summary>
        public static UInt64 NextUInt64(this RNGCryptoServiceProvider rndGen, UInt64 maxValue)
        {
            UInt64 genNumber = rndGen.NextUInt64();

            while (genNumber == UInt64.MaxValue)
            {
                genNumber = rndGen.NextUInt64();
            }
            return((UInt64)((maxValue + 1) * ((decimal)genNumber / (decimal)UInt64.MaxValue)));
        }
 /// <summary>
 /// Generates next random double between 0 and 1.
 /// </summary>
 public static double NextDouble(this RNGCryptoServiceProvider rndGen)
 {
     return((double)((decimal)rndGen.NextUInt64() / (decimal)UInt64.MaxValue));
 }