digest.hmac_sha1
Available inall subroutines.
Returns a SHA-1-based message authentication code based on the supplied
key
and string s
.
Example
declare local var.hmac_sha1 STRING;set var.hmac_sha1 = digest.hmac_sha1("key", "input");# var.hmac_sha1 is now "0x8513bb355076cce2ae5eb9f399ab5cafdba7c8a2"
Try it out
digest.hmac_sha1
is used in the following code examples. Examples apply VCL to real-world use cases and can be deployed as they are, or adapted for your own service. See the full list of code examples for more inspiration.
Click RUN on a sample below to provision a Fastly service, execute the code on Fastly, and see how the function behaves.
Create self-destructing URLs for time-limited access
Make URLs expire after a configurable period.
User contributed notes
BETADo you see an error in this page? Do you have an interesting use case, example or edge case people should know about? Share your knowledge and help people who are reading this page! (Comments are moderated; for support, please contact Fastly support)