This repository has been archived on 2020-12-20. You can view files and clone it, but cannot push or open issues or pull requests.
aurora-sharp-desktop/Aurora/Utils/HashUtil.cs

28 lines
596 B
C#
Raw Normal View History

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;
}
}
}