websitepanel/WebsitePanel.Installer/Sources/WebsitePanel.Setup/Common/StringUtils.cs
2012-09-13 18:20:44 -07:00

19 lines
556 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
namespace WebsitePanel.Setup.Common
{
public class StringUtils
{
public static string GenerateRandomString(int length)
{
RNGCryptoServiceProvider crypto = new RNGCryptoServiceProvider();
byte[] data = new byte[length];
crypto.GetNonZeroBytes(data);
return BitConverter.ToString(data).Replace("-", "").ToLowerInvariant();
}
}
}