CRYPTO.HMAC

Creates an hash based authentication code (HMAC) for given text and secret. The used hash algorithm can be optionally specified. For a list of supported hash algorithms please refere to Hash Algorithms.

Syntax

=CRYPTO.HMAC(Text, Secret [, Algorithm])

Arguments

NameDescription
TextA text to create hash value for.
SecretA text used as key to generate the cryptographic HMAC hash.
AlgorithmOptional. The hash algorithm to use. Defaults to "sha256"

Return Value

The hmac value if no error occurred, otherwise an error value.

Example

FunctionResultComment
=CRYPTO.HMAC("hello", "top secret")a28f6aee6a27565bf1b868da1947c35147039fe6482b35d3b8fdeb9592e42e99By default "sha256" is used.
=CRYPTO.HMAC("hello", "top secret", "md5")9ffaf5da07c95deaa000729cd65fefeaSame text and secret as before but creates an hmac using "md5" algorithm.