.. efun:: string hmac(int method, string key, string value) string hmac(int method, string key, int * arg ) :include: Calculate the Hashed Message Authenication Code for :arg:`value` based on the digest :arg:`method` and the password :arg:`key`. Return the HMAC. :arg:`method` is one of the TLS_HASH_ constants defined in tls.h; not all recognized methods may be supported for a given driven: TLS_HASH_SHA1 (1) TLS_HASH_SHA224 (2) TLS_HASH_SHA256 (3) TLS_HASH_SHA384 (4) TLS_HASH_SHA512 (5) TLS_HASH_MD5 (6) TLS_HASH_RIPEMD160 (7) If the driver is compiled without OpenSSL or GCrypt support an error is thrown. .. usage:: The example below shows how to compute the SHA1 hmac of a string and an array of characters:: string s; s = hmac(TLS_HASH_SHA1, "secret", "Hello"); s = hmac(TLS_HASH_SHA1, "secret", ({ 'H', 'e', 'l', 'l', 'o' }) ); :history 3.3.714 introduced: .. seealso:: :efun:`crypt`, :efun:`md5`, :efun:`md5_crypt`, :efun:`sha1`, :efun:`hmac`