Skip to content

li0ard/sm3

Repository files navigation

@li0ard/sm3
SM3 hash function in pure TypeScript
docs




Installation

# from NPM
npm i @li0ard/sm3

# from JSR
bunx jsr i @li0ard/sm3

Features

  • 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")));

About

SM3 hash function in pure TypeScript

Topics

Resources

License

Stars

Watchers

Forks

Contributors