MD5 Hash – library MetaTrader 5

128-byte algorithm of hashing developed by a professor Ronald Linn Rivest from Massachusetts Institute of Technology (MIT) in 1991.

The example of using

#include <MD5Hash.mqh>

CMD5Hash  md5;

string str="Now it is easy to control MQL5 data integrity!";
uchar bytes[]; StringToCharArray(str, bytes, 0, StringLen(str)); // transferred string to the byte array // without the last one\0
Print(md5.Hash(bytes, ArraySize(bytes))); // print MD5-hash 
---------------------------------------------------------------------
The result:
c25688ecc77d8141b2f85320809e2a35

As an array we can pass the data read from FileReadArray file, etc.

It will be useful

  • to check data integrity when reading Internet files.
  • to compare files.
  • for hashing personal data and sending to the Internet.
  • for personal data storage in an encrypted type.


📈 ROBOTFX MetaTrader Expert Advisors and Indicators to maximize profits and minimize the risks