Welcome Forex EA downloads & MT4/MT5 auto-trading resources — EAs, Gold EAs, quant tools and real-world automation.
Sign In Sign Up

SHA256, SHA384 and SHA512 + HMAC - MetaTrader 4 Library

author EAcpu | 2 reads | 0 comments |

Many developers require these capabilities when working with different types of external APIs, such as Bitcoin and altcoin exchanges, which often require sending data via HMAC-SHA512, HMAC-SHA384, and HMAC-SHA256 and confirming parameter validity.

The MQL5 version of the SHA512 library can be found here: https://www.mql5.com/en/code/18158 . In addition to SHA512, SHA256 and SHA384 support have been added as separate libraries.

The HMAC function is transplanted from https://en.wikipedia.org/wiki/Hash-based_message_authentication_code

Usage example (tested at http://www.freeformatter.com/hmac-generator.html )


Attachment download

📎 sha256.mqh (15.71 KB)

📎sha384.mqh (18.43 KB)

📎 sha512.mqh (18.52 KB)

📎 sha_hmac.mq4 (1.85 KB)

Source: MQL5 #21065

Verification code Refresh