Socket
Socket
Sign inDemoInstall

isomorphic-webcrypto

Package Overview
Dependencies
17
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    isomorphic-webcrypto

isomorphic webcrypto for IE11+ in 3kB


Version published
Weekly downloads
86K
increased by10%
Maintainers
1
Install size
2.23 MB
Created
Weekly downloads
 

Readme

Source

isomorphic-webcrypto NPM

isomorphic webcrypto library for IE11+ in 3kB

What?

There's a great Node polyfill for the Web Crypto API, but it's not isomorphic yet. This fills the gap until it is.

IE11 and versions of Safari < 11 use an older version of the spec, so the browser implementation includes a webcrypto-shim to iron out the differences. You'll still need to provide your own Promise polyfill.

Install

npm install isomorphic-webcrypto

Usage

There's a simple example below, but there are many more here.

const crypto = require('isomorphic-webcrypto')

crypto.subtle.digest(
  { name: 'SHA-256' },
  new Uint8Array([1,2,3]).buffer
)
.then(hash => {
  // do something with the hash buffer
})

Compatibility

See webcrypto-shim's supported browsers

I just want to drop in a script tag

You should use the webcrypto-shim library directly:

<!-- Any Promise polyfill will do -->
<script src="https://unpkg.com/bluebird"></script>
<script src="https://unpkg.com/webcrypto-shim"></script>

License

MIT

Keywords

FAQs

Last updated on 06 Jan 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc