Skip to main content
Version: Streamsheets 2.5

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 refer to Hash Algorithms. The used hash algorithms are from the OpenSSL Library. See their docs for more details.

Syntax

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

Arguments

NameTypeDescription
TextStringA text to create hash value for.
SecretStringA text used as key to generate the cryptographic HMAC hash.
Algorithm (optional)StringThe hash algorithm to use. Defaults to "sha256"

Return

The hmac value or an Error Code

Examples

FormulaResultComment
=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.