Initial update to .net core 6 rc2, haven't run it yet

This commit is contained in:
2021-10-15 20:09:04 +00:00
parent c22f0231e0
commit 1e27ec2366
4 changed files with 23 additions and 20 deletions

View File

@@ -13,7 +13,9 @@ namespace AyaNova.Util
{
using (FileStream stream = File.OpenRead(filePath))
{
SHA256Managed sha = new SHA256Managed();
//SHA256Managed sha = new SHA256Managed();
var sha= SHA256.Create();
byte[] checksum = sha.ComputeHash(stream);
return BitConverter.ToString(checksum).Replace("-", String.Empty);
}

View File

@@ -55,7 +55,8 @@ namespace AyaNova.Util
throw new ArgumentException("characterSet must not be empty", "characterSet");
var bytes = new byte[length * 8];
new RNGCryptoServiceProvider().GetBytes(bytes);
//new RNGCryptoServiceProvider().GetBytes(bytes);
RandomNumberGenerator.Create().GetBytes(bytes);
var result = new char[length];
for (int i = 0; i < length; i++)
{