digestif

0.1.9 • Public • Published

digestif

2954 1173

Cross-platform SHA2 hash digests.

This library produces digest hashes for any binary type or string with a very low footprint and impact on bundle size in browsers.

It also works in Node.js but still restricts itself to the hash types supported in the browser without external dependencies.

const digest = require('digestif')
let hash = digest('hello world') // defaults to sha256
assert(hash instanceof ArrayBuffer)
 
// Accepts any binary type
hash = digest(new Uint8Array(20))
 
// Supports SHA2 256, 384 and 512
hash = digest('hello world', 'SHA-512')

Readme

Keywords

none

Package Sidebar

Install

npm i digestif

Weekly Downloads

0

Version

0.1.9

License

(Apache-2.0 AND MIT)

Unpacked Size

5.14 kB

Total Files

7

Last publish

Collaborators

  • mikeal