hmac-isomorphic

0.0.1 • Public • Published

hmac-isomorphic

Usage

Make sure that whatever build system you are using (Webpack etc) is honoring the browser field in package.json. Then import the library.

The module provides a single function that returns a promise, both in node and in the browser. There are three arguments:

  1. algo, string: the signing algorithim to use. Can be sha256, sha512, etc. Be sure to use the naming mechanism from nodejs, e.g. sha256 not SHA-256.
  2. key, string: the encryption key to use. This should be secret.
  3. message, string: the message to generate the signature from.
const createHmacDigest = require('hmac-isomorphic');
createHmacDigest('sha256', 'abc123', 'def456').then(console.log);

Implementation

Readme

Keywords

none

Package Sidebar

Install

npm i hmac-isomorphic

Weekly Downloads

1

Version

0.0.1

License

ISC

Unpacked Size

2.59 kB

Total Files

4

Last publish

Collaborators

  • justinph