Files
podnoms/server/Utils/Crypt/HMACGenerator.cs
Fergal Moran 8d69c72b83 Merge Repos
2017-10-30 20:42:23 +00:00

20 lines
518 B
C#
Executable File

using System.Security.Cryptography;
using System.Text;
namespace PodNoms.Api.Utils.Crypt
{
public class HMACGenerator
{
public static byte[] CalculateHMACSHA256(string key, string input)
{
return CalculateHMACSHA256(Encoding.ASCII.GetBytes(key), Encoding.ASCII.GetBytes(input));
}
public static byte[] CalculateHMACSHA256(byte[] key, byte[] input)
{
var hash = new HMACSHA256(key);
return hash.ComputeHash(input);
}
}
}