This repository has been archived on 2021-03-06. You can view files and clone it, but cannot push or open issues or pull requests.
aurora-cradle-sharp/AuroraSignal/Src/Utils/HashUtil.cs

26 lines
647 B
C#
Raw Normal View History

2021-03-05 16:56:51 +00:00
using System.Security.Cryptography;
using System.Text;
using System;
namespace Aurora.Utils
{
public class HashUtil
{
public static Guid GetHash(string[] inputs)
{
string input = "";
foreach (string str in inputs)
{
input += str;
}
byte[] stringbytes = Encoding.UTF8.GetBytes(input);
byte[] hashedBytes = new System.Security.Cryptography
.SHA1CryptoServiceProvider()
.ComputeHash(stringbytes);
Array.Resize(ref hashedBytes, 16);
return new Guid(hashedBytes);
}
}
}