crypto.HMAC
语法
crypto.HMAC HASH_TYPE KEY MESSAGE [ENCODING]
返回值
string
别名
hmac
将 HASH_TYPE
参数设置为 md5
、sha1
、sha256
或 sha512
。
将可选的 ENCODING
参数设置为 hex
(默认)或 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=