using System.Collections.Generic;
using System.Security.Cryptography;
public static void Main()
public static void NavigatedPage()
string bytes = "<?xml version=\"1.0\" encoding=\"utf-8\" ?><Command> <LMI_PAYMENT_NO>1000</LMI_PAYMENT_NO><LMI_MERCHANT_ID>2096</LMI_MERCHANT_ID> <LMI_HASH></LMI_HASH> <LMI_PAYMENT_SYSTEM>18</LMI_PAYMENT_SYSTEM> <LMI_PAYMENT_AMOUNT>1001</LMI_PAYMENT_AMOUNT> <LMI_PAYMENT_DESC>Оплата договора</LMI_PAYMENT_DESC></Command>";
byte[] keyByte = Encoding.UTF8.GetBytes(key);
HMACSHA256 hmacsha256 = new HMACSHA256(keyByte);
byte[] messageBytes = Encoding.UTF8.GetBytes(message);
byte[] hashmessage = hmacsha256.ComputeHash(messageBytes);
var tempHash = ByteToString(hashmessage);
Console.WriteLine(tempHash);
public static string ByteToString(byte[] buff)
for (int i = 0; i < buff.Length; i++)
sbinary += buff[i].ToString("X2");