CapRaffle.Domain.Implementation.AccountRepository.GeneratePassword C# (CSharp) Method

GeneratePassword() private method

private GeneratePassword ( ) : string
return string
        private string GeneratePassword()
        {
            string allowedChars = "abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ0123456789!@$?_-";
            char[] chars = new char[8];
            Random rd = new Random();

            for (int i = 0; i < 8; i++)
            {
                chars[i] = allowedChars[rd.Next(0, allowedChars.Length)];
            }
            return new string(chars);
        }