1.0.3 • Published 7 years ago

async-sha256 v1.0.3

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

async sha256 function, using native crypto

This package contains a async sha256 function using the native crypto API. Calling this function with an 'await' requires the code to be within a async block, see the below examples.

Note:

This requires a modern browser that supports native crypto.

Installation

npm install --save async-sha256

Usage

import sha256 from 'async-sha256';

sha256('matt').then(function(hash) {
console.log(hash);//eslint-disable-line
});

Or:

import sha256 from 'async-sha256';

async function doSomething() {
  const hash = await sha256('matt');
  console.log(hash);//eslint-disable-line
}
doSomething();

Change log

1.0.3

  • Pushed: updated read me to include instructions noting that this currently only works in modern browsers and not node.

1.0.2

  • Pushed: modified exports to work correctly.

1.0.1

  • Pushed: changed code examples.

1.0.0

  • Pushed: relocated file, fixed bug, this can be 1.0.

0.9.0

  • Pushed: first version
1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago