This commit is contained in:
4
.vscode/launch.json
vendored
4
.vscode/launch.json
vendored
@@ -53,8 +53,8 @@
|
||||
"AYANOVA_FOLDER_USER_FILES": "c:\\temp\\RavenTestData\\userfiles",
|
||||
"AYANOVA_FOLDER_BACKUP_FILES": "c:\\temp\\RavenTestData\\backupfiles",
|
||||
"AYANOVA_FOLDER_TEMPORARY_SERVER_FILES": "c:\\temp\\RavenTestData\\tempfiles",
|
||||
"AYANOVA_SERVER_TEST_MODE": "true",
|
||||
"AYANOVA_SERVER_TEST_MODE_SEEDLEVEL": "huge",
|
||||
"AYANOVA_SERVER_TEST_MODE": "false",
|
||||
"AYANOVA_SERVER_TEST_MODE_SEEDLEVEL": "small",
|
||||
"AYANOVA_SERVER_TEST_MODE_TZ_OFFSET": "-7",
|
||||
"AYANOVA_BACKUP_PG_DUMP_PATH": "C:\\data\\code\\postgres_14\\bin\\"
|
||||
},
|
||||
|
||||
@@ -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