Module: crypto/hash

Provides an interface to hashing functions available in Node.js or external libraries.

Source:
See:

Requires

  • module:asmcrypto.js
  • module:hash.js
  • module:web-stream-tools
  • module:crypto/hash/md5
  • module:util

Members

(static) md5

Source:
See:
  • module:md5

(static) ripemd

Source:
See:
  • hash.js

(static) sha1

Source:
See:
  • asmCrypto

(static) sha224

Source:
See:
  • hash.js

(static) sha256

Source:
See:
  • asmCrypto

(static) sha384

Source:
See:
  • hash.js

(static) sha512

Source:
See:
  • asmCrypto

Methods

(static) digest(algo, data) → {Uint8Array}

Create a hash on the specified data using the specified algorithm

Parameters:
Name Type Description
algo module:enums.hash

Hash algorithm type (see RFC 4880 9.4)

data Uint8Array

Data to be hashed

Source:
Returns:

hash value

Type
Uint8Array

(static) getHashByteLength(algo) → {Integer}

Returns the hash size in bytes of the specified hash algorithm type

Parameters:
Name Type Description
algo module:enums.hash

Hash algorithm type (See RFC 4880 9.4)

Source:
Returns:

Size in bytes of the resulting hash

Type
Integer