Namespace: crypto

$.security. crypto

Namespace: crypto

Methods

md5(data, key) → {ArrayBuffer}

Computes MD5 hash or HMAC-MD5
Parameters:
Name Type Argument Description
data String | ArrayBuffer String or binary data to produce the hash from. If the parameter is of type String, its UTF-8 representation will be considered
key String <optional>
Key used for HMAC-MD5 generation
Throws:
Throws an error if the input parameters are invalid
Returns:
Type
ArrayBuffer

sha1(data, key) → {ArrayBuffer}

Computes SHA1 or HMAC-SHA1
Parameters:
Name Type Argument Description
data String | ArrayBuffer String or binary data to produce the hash from. If the parameter is of type String, its UTF-8 representation will be considered
key String <optional>
Key used for HMAC-SHA1 generation
Throws:
Throws an error if the input parameters are invalid
Returns:
Type
ArrayBuffer

sha256(data, key) → {ArrayBuffer}

Computes SHA256 or HMAC-SHA256
Parameters:
Name Type Argument Description
data String | ArrayBuffer String or binary data to produce the hash from. If the parameter is of type String, its UTF-8 representation will be considered
key String <optional>
Key used for HMAC-SHA256 generation
Throws:
Throws an error if the input parameters are invalid
Returns:
Type
ArrayBuffer