Many developers need these functions, while working with different kinds of external APIs, like Bitcoin and altcoin exchanges where it is often necessary to send data with the confirmation of parameters validity through HMAC-SHA512, HMAC-SHA384 and HMAC-SHA256.
The MQL5 version of SHA512 library can be found here: Besides SHA512, added SHA256 and SHA384 support in form of separate libraries.
- The SHA512 class was ported from
- The SHA384 class was ported from
- The SHA256 class was ported from
HMAC functions were ported from
Use example (tested on
#include <SHA256.mqh> #include <SHA384.mqh> #include <SHA512.mqh> input string phrase = "The quick brown fox jumps over the lazy dog"; input string phrase_key = "ABCDEFG"; void Start() Â Â { Â Â SHA256 hash256; Â Â Print("SHA256:",hash256.hmac(phrase,phrase_key)); Â Â SHA384 hash384; Â Â Print("SHA384:",hash384.hmac(phrase,phrase_key)); Â Â SHA512 hash512; Â Â Print("SHA512:",hash512.hmac(phrase,phrase_key)); Â Â }