cross-sha256
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

cross-sha256

NPM Package Build Status

Isomorphic SHA-256 with minimal dependencies. Uses the Node.js crypto module if available, otherwise uses a JS implementation (e.g. in browser environments).

import { sha256 } from 'cross-sha256'

console.log(new sha256().update('42').digest('hex'))
// => 73475cb40a568e8da8a045ced110137e159f890ac4da883b6b17dc651b3a8049

Acknowledgements

This work is derived from Paul Johnston's A JavaScript implementation of the Secure Hash Algorithm.

LICENSE MIT

Dependents (17)

Package Sidebar

Install

npm i cross-sha256

Weekly Downloads

15,987

Version

1.2.0

License

(MIT AND BSD-3-Clause)

Unpacked Size

23.6 kB

Total Files

7

Last publish

Collaborators

  • zone117x