First pass at members resource controller
This commit is contained in:
27
Aurora/Utils/HashUtil.cs
Normal file
27
Aurora/Utils/HashUtil.cs
Normal file
@ -0,0 +1,27 @@
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System;
|
||||
|
||||
namespace Aurora.Utils
|
||||
{
|
||||
public class HashUtil
|
||||
{
|
||||
public static Guid GetHashGuid(string[] inputs)
|
||||
{
|
||||
string input = "";
|
||||
foreach (string str in inputs)
|
||||
{
|
||||
input += str;
|
||||
}
|
||||
|
||||
Guid result;
|
||||
using (SHA256 sha = SHA256.Create())
|
||||
{
|
||||
byte[] hash = sha.ComputeHash(Encoding.Default.GetBytes(input));
|
||||
result = new Guid(hash);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user