コード例 #1
0
        public static byte[] NextBytes(this IRNG <ulong> rng, int count)
        {
            if (rng == null)
            {
                throw new ArgumentNullException(nameof(rng));
            }
            if (count < 0)
            {
                throw new ArgumentOutOfRangeException(nameof(count));
            }
            if (count == 0)
            {
                return(new byte[0]);
            }

            var rv = new byte[count];

            rng.Fill(rv);
            return(rv);
        }