Successful unit test setup and tear down

This commit is contained in:
watsonb8
2020-01-20 22:53:33 -05:00
parent 28afcf12e4
commit df2a6b4bfc
8 changed files with 159 additions and 41 deletions

View File

@ -6,7 +6,7 @@ namespace Aurora.Utils
{
public class HashUtil
{
public static Guid GetHashGuid(string[] inputs)
public static Guid GetHash(string[] inputs)
{
string input = "";
foreach (string str in inputs)
@ -14,14 +14,12 @@ namespace Aurora.Utils
input += str;
}
Guid result;
using (SHA256 sha = SHA256.Create())
{
byte[] hash = sha.ComputeHash(Encoding.Default.GetBytes(input));
result = new Guid(hash);
}
return result;
byte[] stringbytes = Encoding.UTF8.GetBytes(input);
byte[] hashedBytes = new System.Security.Cryptography
.SHA1CryptoServiceProvider()
.ComputeHash(stringbytes);
Array.Resize(ref hashedBytes, 16);
return new Guid(hashedBytes);
}
}
}