Successful unit test setup and tear down
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user