isomorphic-webcrypto
Advanced tools
Comparing version 0.0.2 to 1.0.0
{ | ||
"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 |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
3437
1
46
1