digest.hmac_sha512_base64

STRINGdigest.hmac_sha512_base64STRINGkeySTRINGinput

Available in all subroutines.

Hash-based message authentication code using SHA-512. Returns a Base64-encoded string.

Example

declare local var.hmac_sha512_base64 STRING;
set var.hmac_sha512_base64 = digest.hmac_sha512_base64("key", "input");
# var.hmac_sha512_base64 is now "A613yBfzJmnMzzjayRXU5VoWgzscpoWXmp31IaBSNZeAkAQ8PaQC2tNl7TmsBa9IZKgERRhh9LTfdoCDTG1PlQ=="

Try it out

digest.hmac_sha512_base64 is used in the following solution recipes, which show real world use cases. Click RUN to provision a Fastly service, execute the code on Fastly, and see how the function behaves.

JSON web tokens

Decode the popular JWT format to verify user session tokens before forwarding trusted authentication data to your origin.

User contributed notes

We welcome comments that add use cases, ideas, tips, and caveats. All comments will be moderated before publication. To post support questions, visit our support center and we'll find you the help you need.