Implementation of the GOST R 34.11–2018 (Streebog) hashing algorithm in JavaScript. Supports generating 256-bit and 512-bit hash values.
Works in both Node.js and browsers.
npm install @gimpel/streebogimport { Streebog } from '@gimpel/streebog';
const hash512 = new Streebog(512)
.update('Hello, ')
.update('World!')
.digest('hex');
console.log(hash512); The hash is computed step-by-step as data is received, which allows processing large volumes of information without loading the entire content into memory.
Data passed to update() accumulates in an internal buffer. When the accumulated data reaches the block size — 512 bits (64 bytes) — the block is immediately processed by the algorithm. This way, the library doesn’t keep the entire input in memory.
import { Streebog } from '@gimpel/streebog';
const hash256 = Streebog.hash('Hello, World!', 256, 'hex');
console.log(hash256);import { Streebog } from '@gimpel/streebog';
const bytes = Streebog.hash('Hello, World!', 512, 'buffer');
console.log(bytes);