//+------------------------------------------------------------------+ //| Test.mq5 | //| Copyright 2026, Niquel Mendoza | //| https://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2026, Niquel Mendoza" #property link "https://www.mql5.com" #property version "1.00" #property strict //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ #include "Main.mqh" #include "..\\..\\Utils\\Main.mqh" //+------------------------------------------------------------------+ //| Script program start function | //+------------------------------------------------------------------+ void OnStart() { //--- string secret_key = "mi_clave_secreta"; string message = "mensaje a firmar"; uchar key[]; uchar msg[]; int key_len = StringToCharArray(secret_key, key, 0, -1, CP_UTF8); ArrayResize(key, key_len - 1); // quitar el null terminator int msg_len = StringToCharArray(message, msg, 0, -1, CP_UTF8); ArrayResize(msg, msg_len - 1); // quitar el null terminator TSN::CHMac hmac(key, msg, TSN::CCryptoHashMeta::TSN_CRYPTO_HASH_TYPE_SHA256); string str = ""; TSN::CEncrptUtils::ToHexUpper(hmac.m_out, str); Print(str); // 963DEA2D00F7FFFF21092A4B62F9CE9410ABD340AC51F8D6649C4AD056DCF9C2 resultado // 963dea2d00f7ffff21092a4b62f9ce9410abd340ac51f8d6649c4ad056dcf9c2 verificacion } //+------------------------------------------------------------------+