//+------------------------------------------------------------------+ //| 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 //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ 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[]; ulong a = GetMicrosecondCount(); for(int i = 0; i < 5000; i++) { TSN::COAEP::Encode(mensaje, 256, random, TSN::CCryptoHashMeta::TSN_CRYPTO_HASH_TYPE_SHA256, coded); } ulong b = GetMicrosecondCount(); Print("time: ", (b - a)); //--- string str = ""; TSN::CNumberUtils::BytesToHexLower(coded, 256, str); Print(str[0]); } //+------------------------------------------------------------------+