hash

Generates a hash of the given data using the specified algorithm.

It uses the Web Crypto API to generate the hash.

Note: If you need a secure hash use a specialized library like crypto-js instead.

Example