CryptoByLeo/Src/RSPParser/IntTest.mq5

53 lines
1.9 KiB
MQL5

2026-09-02 07:44:15 -05:00
//+------------------------------------------------------------------+
//| IntTest.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 "Iteradores.mqh"
#include <TSN\\BInt\\NUtils.mqh>
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
#resource "SHA3_512ShortMsg.rsp" as const string g_raw
//+------------------------------------------------------------------+
//| Script program start function |
//+------------------------------------------------------------------+
void OnStart()
{
//---
//---
TSN::CRSPParser rsp;
//---
rsp.Assing(g_raw);
rsp.CorrectPadding();
rsp.Parse();
TSN::CRSPNode node = rsp.GetRoot();
node.MoveNextPositionsThis(3); // siguiente triplete
//---
const string keys[3] = {"Len", "Msg", "MD"};
CRSPIteratorHashFast(3) it = node.MakeHashIterator<MQLA_B(3), TSN::CGenericHash_string>(keys);
uchar buf[];
TSN::CRSPNode msg = it.At(0)["MD"].Value();
Print(msg.ToString());
const int t = msg.HexToBytes(buf);
string out = "";
2026-09-26 21:47:11 -05:00
TSN::CHexUtils::BytesToHexLower(buf, t, out);
2026-09-02 07:44:15 -05:00
Print(out);
}
//+------------------------------------------------------------------+