//+------------------------------------------------------------------+ //| Full.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 //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ class CRandomTest { public: CRandomTest(void) {} ~CRandomTest(void) {} static void Random(uchar& out[], int olt, int i) { olt += i; for(; i < olt; i++) { out[i] = 0xAA; } } }; //+------------------------------------------------------------------+ //| Script program start function | //+------------------------------------------------------------------+ void OnStart() { //--- mensaje string mensaje_str = "hola mundo"; uchar mensaje[]; StringToCharArray(mensaje_str, mensaje, 0, StringLen(mensaje_str)); //--- random uchar random[]; ArrayResize(random, CRYPTOBYLEO_SHA256_SIZET_FHASH); CRandomTest::Random(random, CRYPTOBYLEO_SHA256_SIZET_FHASH, 0); //--- uchar coded[]; TSN::COAEP::Encode(mensaje, 256, random, TSN::CCryptoHashMeta::TSN_CRYPTO_HASH_TYPE_SHA256, coded); //--- uchar out[]; const int t = TSN::COAEP::Decode(coded, 256, TSN::CCryptoHashMeta::TSN_CRYPTO_HASH_TYPE_SHA256, out); //--- string str = ""; TSN::CNumberUtils::BytesToHexLower(out, t, str); Print(str); Print(CharArrayToString(out, 0, t)); // 2026.08.20 17:21:51.090 Full (EURUSD,H1) hola mundo } //+------------------------------------------------------------------+