mirror of
https://github.com/emn178/js-sha256.git
synced 2026-08-13 04:51:56 +08:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9a54fb31d4 | ||
|
|
1559263f5b |
@@ -1,8 +1,9 @@
|
|||||||
# js-sha256
|
# js-sha256
|
||||||
[](https://github.com/emn178/js-sha256/actions/workflows/ci.yml)
|
[](https://github.com/emn178/js-sha256/actions/workflows/ci.yml)
|
||||||
[](https://coveralls.io/r/emn178/js-sha256?branch=master)
|
[](https://coveralls.io/r/emn178/js-sha256?branch=master)
|
||||||
[](https://cdnjs.com/libraries/js-sha256/)
|
[](https://www.npmjs.com/package/js-sha256)
|
||||||
[](https://nodei.co/npm/js-sha256/)
|
[](https://www.jsdelivr.com/package/npm/js-sha256)
|
||||||
|
|
||||||
A simple SHA-256 / SHA-224 hash function for JavaScript supports UTF-8 encoding.
|
A simple SHA-256 / SHA-224 hash function for JavaScript supports UTF-8 encoding.
|
||||||
|
|
||||||
## Demo
|
## Demo
|
||||||
@@ -38,13 +39,12 @@ Load the minified UMD build to expose `sha256` and `sha224` as globals:
|
|||||||
|
|
||||||
### ES Modules
|
### ES Modules
|
||||||
```JavaScript
|
```JavaScript
|
||||||
import sha256, { sha224 } from 'js-sha256';
|
import { sha256, sha224 } from 'js-sha256';
|
||||||
```
|
```
|
||||||
|
|
||||||
### CommonJS
|
### CommonJS
|
||||||
```JavaScript
|
```JavaScript
|
||||||
const sha256 = require('js-sha256');
|
const { sha256, sha224 } = require('js-sha256');
|
||||||
const { sha224 } = sha256;
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### API
|
### API
|
||||||
@@ -77,7 +77,7 @@ hash2.array();
|
|||||||
Node.js automatically uses its native `crypto` implementation with the same API:
|
Node.js automatically uses its native `crypto` implementation with the same API:
|
||||||
|
|
||||||
```JavaScript
|
```JavaScript
|
||||||
import sha256, { sha224 } from 'js-sha256';
|
import { sha256, sha224 } from 'js-sha256';
|
||||||
|
|
||||||
const hash = sha256.create();
|
const hash = sha256.create();
|
||||||
hash.update('Message');
|
hash.update('Message');
|
||||||
|
|||||||
Generated
+3
-4
@@ -1412,11 +1412,10 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/picomatch": {
|
"node_modules/picomatch": {
|
||||||
"version": "2.3.2",
|
"version": "2.3.1",
|
||||||
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz",
|
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
|
||||||
"integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==",
|
"integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=8.6"
|
"node": ">=8.6"
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user