@li0ard/sm3
v0.1.1
Published
SM3 hash function in pure TypeScript
Readme
Installation
# from NPM
npm i @li0ard/sm3
# from JSR
bunx jsr i @li0ard/sm3Features
- Provides simple and modern API
- Most of the APIs are strictly typed
- Fully complies with GB/T 32905-2016 (in Chinese) standard
- Supports Bun, Node.js, Deno, Browsers
Examples
import { SM3 } from "@li0ard/sm3";
let hash = new SM3();
hash.update(new TextEncoder().encode("hello world"));
console.log(hash.digest());
// -- OR --
import { sm3 } from "@li0ard/sm3";
console.log(sm3(new TextEncoder().encode("hello world")));