using System;
using System.Collections.Generic;
using System.Text;

namespace Performance.Infrastructure
{
    public class RandomHelper
    {
        /// <summary>
        /// 四位验证码
        /// </summary>
        /// <returns></returns>
        public static string GetSmsCode()
        {
            Random rad = new Random(Guid.NewGuid().GetHashCode());
            var code = rad.Next(1000, 10000);

            return code.ToString().PadLeft(4, '0');
        }
    }
}
