A collection of utilities for calculating SHA-1 or HMAC-SHA-1 values.
To use the sha1 builtin library,
require it with the alloy
root directory in your require
call. For example:
var sha1 = require('alloy/sha1'); var sha1_digest = sha1.hex_sha1('The quick brown fox jumps over the lazy dog.');
Calculates the HMAC-SHA-1 of a key and some data, and returns the value in base-64.
Key to use.
Data to use.
HMAC-SHA-1 value of the string in base-64.
Calculates the SHA-1 of a string and returns the value in base-64.
String to use.
SHA-1 value of the string in base-64.
Calculates the HMAC-SHA-1 of a key and some data, and returns the value in hexadecimal.
Key to use.
Data to use.
HMAC-SHA-1 value of the string in hexadecimal.
Calculates the SHA-1 of a string and returns the value in hexadecimal.
String to use.
SHA-1 value of the string in hexadecimal.
Calculates the HMAC-SHA-1 of a key and some data, and returns the value as a string.
Key to use.
Data to use.
HMAC-SHA-1 value of the string as a string.
Calculates the SHA-1 of a string and returns the value as a string.
String to use.
SHA-1 value of the string as a string.