mirror of
https://git.teknik.io/Teknikode/Teknik.git
synced 2023-08-02 14:16:22 +02:00
19 lines
462 B
C#
19 lines
462 B
C#
using System.Text;
|
|
|
|
namespace Teknik.Utilities.Cryptography
|
|
{
|
|
public class SHA384
|
|
{
|
|
public static byte[] Hash(string key, string value)
|
|
{
|
|
byte[] keyBytes = Encoding.UTF8.GetBytes(key);
|
|
byte[] data = Encoding.UTF8.GetBytes(value);
|
|
|
|
var cipher = new System.Security.Cryptography.HMACSHA384(keyBytes);
|
|
byte[] result = cipher.ComputeHash(data);
|
|
|
|
return result;
|
|
}
|
|
}
|
|
}
|