using System.Security.Cryptography;
public delegate double rectangleDelegate(double Width, double Heigth);
public double GetPerimeter(double Width, double Heigth)
return 2 * (Width + Heigth);
public double GetArea(double Width, double Heigth)
static void Main(string[] args)
string tokenKey = "e1uTy+/blki9cNQPblQMBQ==";
byte[] tokenKeyBinary = Convert.FromBase64String(tokenKey);
using var hmac = new HMACSHA256(tokenKeyBinary);
var hash = hmac.ComputeHash( System.Text.Encoding.UTF8.GetBytes(@"{""siteId"":""NOOlxt3rRruQuEciW6DyCg"",""type"":""HEARTBEAT"",""time"":""2023-11-04T09:08:03.539Z""}"));
var hashInBase64 = Convert.ToBase64String(hash);