hugo/content/en/functions/crypto/HMAC.md
Bjørn Erik Pedersen 9b0050e9aa Squashed 'docs/' content from commit 5c085a37b
git-subtree-dir: docs
git-subtree-split: 5c085a37b297bf12f59efeaae591418ec025c10d
2024-01-27 10:48:33 +01:00

925 B

title description categories keywords action aliases
crypto.HMAC Returns a cryptographic hash that uses a key to sign a message.
aliases related returnType signatures
hmac
functions/crypto/FNV32a
functions/crypto/MD5
functions/crypto/SHA1
functions/crypto/SHA256
string
crypto.HMAC HASH_TYPE KEY MESSAGE [ENCODING]
/functions/hmac

Set the HASH_TYPE argument to md5, sha1, sha256, or sha512.

Set the optional ENCODING argument to either hex (default) or binary.

{{ hmac "sha256" "Secret key" "Secret message" }}
5cceb491f45f8b154e20f3b0a30ed3a6ff3027d373f85c78ffe8983180b03c84

{{ hmac "sha256" "Secret key" "Secret message" "hex" }}
5cceb491f45f8b154e20f3b0a30ed3a6ff3027d373f85c78ffe8983180b03c84

{{ hmac "sha256" "Secret key" "Secret message" "binary" | base64Encode }}
XM60kfRfixVOIPOwow7Tpv8wJ9Nz+Fx4/+iYMYCwPIQ=