Socket
Socket
Sign inDemoInstall

isomorphic-webcrypto

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

isomorphic-webcrypto - npm Package Compare versions

Comparing version 0.0.2 to 1.0.0

browser.js

18

package.json
{
"name": "isomorphic-webcrypto",
"version": "0.0.2",
"description": "",
"browser": "cjs/browser.js",
"main": "cjs/node.js",
"version": "1.0.0",
"description": "isomorphic webcrypto for IE11+ in 3kB",
"browser": "browser.js",
"main": "node.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"no tests\"",
"release": "npm test && git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish"
},

@@ -14,4 +15,7 @@ "repository": {

},
"keywords": [],
"author": "Len Boyette",
"keywords": [
"isomorphic",
"webcrypto",
"small"
],
"license": "MIT",

@@ -18,0 +22,0 @@ "bugs": {

@@ -1,1 +0,46 @@

# isomorphic-webcrypto
# isomorphic-webcrypto [![NPM](https://img.shields.io/npm/v/isomorphic-webcrypto.svg)](https://npmjs.com/package/isomorphic-webcrypto)
isomorphic webcrypto library for IE11+ in 3kB
## What?
There's a great Node polyfill for the [Web Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API), but [it's not isomorphic yet](https://github.com/anvilresearch/webcrypto/issues/57). 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](https://github.com/vibornoff/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](https://github.com/diafygi/webcrypto-examples).
```javascript
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](https://github.com/vibornoff/webcrypto-shim#supported-browsers)
## I just want to drop in a script tag
You should use the webcrypto-shim library directly:
```html
<!-- Any Promise polyfill will do -->
<script src="https://unpkg.com/bluebird"></script>
<script src="https://unpkg.com/webcrypto-shim"></script>
```
## License
MIT
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc