Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/emmansun/sm3js
SM3 for Javascript
https://github.com/emmansun/sm3js
sm3
Last synced: about 2 months ago
JSON representation
SM3 for Javascript
- Host: GitHub
- URL: https://github.com/emmansun/sm3js
- Owner: emmansun
- License: apache-2.0
- Created: 2021-02-18T02:15:36.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-04-02T00:45:03.000Z (9 months ago)
- Last Synced: 2024-10-06T10:17:50.299Z (3 months ago)
- Topics: sm3
- Language: JavaScript
- Homepage:
- Size: 86.9 KB
- Stars: 2
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sm3js
[![SM3JS CI](https://github.com/emmansun/sm3js/actions/workflows/ci.yml/badge.svg)](https://github.com/emmansun/sm3js/actions/workflows/ci.yml)
[![npm version](https://badge.fury.io/js/gmsm-sm3js.svg)](https://badge.fury.io/js/gmsm-sm3js)
[![NPM Downloads][npm-downloads-image]][npm-url]**sm3js is a pure Javascript implementation of the GM-Standards SM3 hash functions.**
If you use sm3 with NodeJs, please use nodejs crypto directly.
const crypto = require('crypto');
function sm3Digest(content) {
const h = crypto.createHash('sm3');
return h.update(content).digest('hex');
}
// sm3Digest('abc') === '66c7f0f462eeedd9d1f2d46bdc10e4e24167c4875cf2f7a2297da02b8f4ba8e0'You can call crypto.getHashes() to check if sm3 is supported or not.
[npm-downloads-image]: https://badgen.net/npm/dm/gmsm-sm3js
[npm-url]: https://npmjs.org/package/gmsm-sm3js