26 lines
647 B
C#
26 lines
647 B
C#
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);
|
|
}
|
|
}
|
|
}
|