Alloy.builtins.sha1

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.');

Defined By

Methods

Alloy.builtins.sha1
( key, data ) : String
Calculates the HMAC-SHA-1 of a key and some data, and returns the value in base-64. ...

Calculates the HMAC-SHA-1 of a key and some data, and returns the value in base-64.

Parameters

  • key : String

    Key to use.

  • data : String

    Data to use.

Returns

  • String

    HMAC-SHA-1 value of the string in base-64.

Alloy.builtins.sha1
( s ) : String
Calculates the SHA-1 of a string and returns the value in base-64. ...

Calculates the SHA-1 of a string and returns the value in base-64.

Parameters

  • s : String

    String to use.

Returns

  • String

    SHA-1 value of the string in base-64.

Alloy.builtins.sha1
( key, data ) : String
Calculates the HMAC-SHA-1 of a key and some data, and returns the value in hexadecimal. ...

Calculates the HMAC-SHA-1 of a key and some data, and returns the value in hexadecimal.

Parameters

  • key : String

    Key to use.

  • data : String

    Data to use.

Returns

  • String

    HMAC-SHA-1 value of the string in hexadecimal.

Alloy.builtins.sha1
( s ) : String
Calculates the SHA-1 of a string and returns the value in hexadecimal. ...

Calculates the SHA-1 of a string and returns the value in hexadecimal.

Parameters

  • s : String

    String to use.

Returns

  • String

    SHA-1 value of the string in hexadecimal.

Alloy.builtins.sha1
( key, data ) : String
Calculates the HMAC-SHA-1 of a key and some data, and returns the value as a string. ...

Calculates the HMAC-SHA-1 of a key and some data, and returns the value as a string.

Parameters

  • key : String

    Key to use.

  • data : String

    Data to use.

Returns

  • String

    HMAC-SHA-1 value of the string as a string.

Alloy.builtins.sha1
( s ) : String
Calculates the SHA-1 of a string and returns the value as a string. ...

Calculates the SHA-1 of a string and returns the value as a string.

Parameters

  • s : String

    String to use.

Returns

  • String

    SHA-1 value of the string as a string.