using System;
using System.Linq;

namespace CommonLibrary
{
    public static class RandomCode
    {
        #region random code
        public static string RadomCode(int size)
        {
            var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
            var random = new Random();
            return new string(
                Enumerable.Repeat(chars, size)
                    .Select(s => s[random.Next(s.Length)])
                    .ToArray());
        }

        #endregion

        #region random number
        public static int RandomNumber(int min, int max)
        {
            Random random = new Random();
            return random.Next(min, max);
        }

        #endregion


    }
}
