//+------------------------------------------------------------------+ //| Test512.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 "..\\SHA512.mqh" #include "..\\..\\Utils\\Main.mqh" //+------------------------------------------------------------------+ //| Script program start function | //+------------------------------------------------------------------+ void OnStart() { //--- uchar fin[CRYPTOBYLEO_SHA512_SIZET_FHASH]; //--- /* uchar data[]; ArrayResize(data, 3); data[0] = 'a'; data[1] = 'b'; data[2] = 'c'; TSN::CCryptoHash::SHA512(data, 3, fin); string out = ""; TSN::CEncrptUtils::ToHexUpper(fin, out); Print(out);*/ //--- int DataSizeMB = 1; int dataSize = DataSizeMB * 1024 * 1024; uchar data[]; ArrayResize(data, dataSize); MathSrand(42); for(int i = 0; i < dataSize; i++) data[i] = (uchar)(MathRand() % 256); ulong a = GetMicrosecondCount(); TSN::CCryptoHash::SHA512(data, dataSize, fin); ulong b = GetMicrosecondCount(); double shaSeconds = (b - a) / 1000000.0; double shaMBs = DataSizeMB / shaSeconds; PrintFormat(" Tiempo: %.4f s", shaSeconds); PrintFormat(" Velocidad: %.2f MB/s", shaMBs); uchar r = 0; for(int i = 0; i < 64; i++) r += fin[i]; Print(r); } //+------------------------------------------------------------------+ // DDAF35A193617ABACC417349AE20413112E6FA4E89A97EA20A9EEEE64B55D39A2192992A274FC1A836BA3C23A3FEEBBD454D4423643CE80E2A9AC94FA54CA49F // ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f