@li0ard/streebog
v0.2.5
Published
Streebog hash function in pure TypeScript
Readme
[!WARNING] This library is currently in alpha stage: the lib is not very stable yet, and there may be a lot of bugs feel free to try it out, though, any feedback is appreciated!
Installation
# from NPM
npm i @li0ard/streebog
# from JSR
bunx jsr i @li0ard/streebogSupported modes
- [x] Hash function
- [x] PBKDF2 (for 512 bit)
- [x] HMAC (256/512 bit)
- [x]
KDF_GOSTR3411_2012_256andKDF_TREE_GOSTR3411_2012_256
Features
- Provides simple and modern API
- Most of the APIs are strictly typed
- Fully complies with GOST R 34.11-2012 (RFC 6986) standards
- Supports Bun, Node.js, Deno, Browsers
Examples
Streebog 256 bit (aka GOST R 34.11-2012 256 bit)
import { streebog256 } from "@li0ard/streebog"
console.log(streebog256(new TextEncoder().encode("hello world")))
// OR
import { Streebog256 } from "@li0ard/streebog"
const hash = new Streebog256()
hash.update(new TextEncoder().encode("hello world"))
console.log(hash.digest())Streebog 512 bit (aka GOST R 34.11-2012 512 bit)
import { streebog512 } from "@li0ard/streebog"
console.log(streebog512(new TextEncoder().encode("hello world")))
// OR
import { Streebog512 } from "@li0ard/streebog"
const hash = new Streebog512()
hash.update(new TextEncoder().encode("hello world"))
console.log(hash.digest())