Compare commits

...
Author SHA1 Message Date
Yi-Cyuan Chen 9a54fb31d4 update README 2026-07-27 14:50:56 +08:00
Yi-Cyuan Chen 1559263f5b update README 2026-07-27 14:44:03 +08:00
+6 -6
View File
@@ -1,8 +1,9 @@
# js-sha256 # js-sha256
[![CI](https://github.com/emn178/js-sha256/actions/workflows/ci.yml/badge.svg)](https://github.com/emn178/js-sha256/actions/workflows/ci.yml) [![CI](https://github.com/emn178/js-sha256/actions/workflows/ci.yml/badge.svg)](https://github.com/emn178/js-sha256/actions/workflows/ci.yml)
[![Coverage Status](https://coveralls.io/repos/emn178/js-sha256/badge.svg?branch=master)](https://coveralls.io/r/emn178/js-sha256?branch=master) [![Coverage Status](https://coveralls.io/repos/emn178/js-sha256/badge.svg?branch=master)](https://coveralls.io/r/emn178/js-sha256?branch=master)
[![CDNJS](https://img.shields.io/cdnjs/v/js-sha256.svg)](https://cdnjs.com/libraries/js-sha256/) [![NPM](https://img.shields.io/npm/v/js-sha256)](https://www.npmjs.com/package/js-sha256)
[![NPM](https://nodei.co/npm/js-sha256.png?stars&downloads)](https://nodei.co/npm/js-sha256/) [![CDNJS](https://img.shields.io/jsdelivr/npm/hm/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');