using System.Security.Cryptography;
public static void Main()
string jsonString = "{\"id\":79120,\"key\":\"73233b9e34fc7e9e5ce3ad02fa092b38bc6fe374bafa96756015d2aee3624610da39a3ee5e6b4b0d3255bfef95601890afd80709\",\"username\":\"Pandora Reeves\",\"user_id\":8103247,\"amount\":48,\"status\":\"APPROVED\",\"token\":\"237e14fc-3813-4782-983e-0c75655d5e64\",\"method\":\"creditCard\",\"date\":{\"date\":\"2024-07-31 09:05:30.709919\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"type\":\"CASH_OUT\",\"message\":\"Hatal\"}";
string secretKey = "a.eUr>C9EY8Hmb3MAfP%[t";
using (HMACSHA256 hmac = new HMACSHA256(Encoding.UTF8.GetBytes(secretKey)))
hash = hmac.ComputeHash(Encoding.UTF8.GetBytes(jsonString));
string hashHex = BitConverter.ToString(hash).Replace("-", "").ToLower();
string base64EncodedHash = Base64Encode(hashHex);
Console.WriteLine(base64EncodedHash);
public static string Base64Encode(string plainText)
var plainTextBytes = Encoding.UTF8.GetBytes(plainText);
return Convert.ToBase64String(plainTextBytes);