28 lines
596 B
C#
28 lines
596 B
C#
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;
|
|
}
|
|
}
|
|
}
|