Skip to content

Commit b6ec971

Browse files
sergiom371msallin
authored andcommitted
Update HashCreator.cs
SHA512.Create() will return a new SHA512Managed instance by default. But, if FIPS restriction is enabled, it will return an instance FIPS-compliant
1 parent 881965e commit b6ec971

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

SQLite.CodeFirst/Internal/Utility/HashCreator.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,22 @@
11
using System;
2+
using System.Diagnostics;
23
using System.Security.Cryptography;
34
using System.Text;
5+
using System.Threading;
46

57
namespace SQLite.CodeFirst.Utility
68
{
79
internal static class HashCreator
810
{
911
public static string CreateHash(string data)
1012
{
13+
while (!Debugger.IsAttached)
14+
{
15+
Thread.Sleep(100);
16+
}
17+
1118
byte[] dataBytes = Encoding.ASCII.GetBytes(data);
12-
using (SHA512 sha512 = new SHA512CryptoServiceProvider())
19+
using (SHA512 sha512 = SHA512.Create())
1320
{
1421
byte[] hashBytes = sha512.ComputeHash(dataBytes);
1522
string hash = Convert.ToBase64String(hashBytes);

0 commit comments

Comments
 (0)