Skip to main content

http.hash.hmacsha1(dataToHash, key)

Performs an HMAC-SHA1 hash function

Availability

Agent

Parameters

Name Type Description
dataToHash String or blob The data to which the hash function will be applied
key String or blob The hash key

Returns

Blob — the hashed data (20 bytes)

Description

This method performs an HMAC-SHA1 hash using the input data and key. Because the returned data is a blob, it is not uncommon to Base64-encode it.

Example Code

The following code uses HMAC-SHA-1 to create a Twitter user context, and to Tweet.