This commit is contained in:
@@ -52,16 +52,14 @@ namespace AyaNova.Util
|
||||
{
|
||||
if (length < 0)
|
||||
throw new ArgumentException("length must not be negative", "length");
|
||||
if (length > int.MaxValue / 8) // 250 million chars ought to be enough for anybody
|
||||
if (length > int.MaxValue / 8)
|
||||
throw new ArgumentException("length is too big", "length");
|
||||
if (characterSet == null)
|
||||
throw new ArgumentNullException("characterSet");
|
||||
var characterArray = characterSet.Distinct().ToArray();
|
||||
if (characterArray.Length == 0)
|
||||
throw new ArgumentException("characterSet must not be empty", "characterSet");
|
||||
|
||||
var bytes = new byte[length * 8];
|
||||
//new RNGCryptoServiceProvider().GetBytes(bytes);
|
||||
RandomNumberGenerator.Create().GetBytes(bytes);
|
||||
var result = new char[length];
|
||||
for (int i = 0; i < length; i++)
|
||||
|
||||
Reference in New Issue
Block a user