Rust · WebAssembly · TypeScript

WebBuf
High-performance buffer manipulation and cryptography for the web, written in Rust, compiled to WebAssembly, and shipped as zero-config TypeScript packages.
bash
npm install webbuf@webbuf/sha256 · README
import { sha256Hash } from "@webbuf/sha256";
import { WebBuf } from "@webbuf/webbuf";
const data = WebBuf.fromUtf8("abc");
const hash = sha256Hash(data);
console.log(hash.toHex());00ba7816bf8f01cfea08414140de5dae222310b00361a396177a9c18b410ff61f20015ad
Features
One buffer type from Rust to TypeScript.
Rust-powered
Cryptography written or wrapped in Rust and compiled to WebAssembly for native-grade performance.
Synchronous loading
WASM is inlined as base64, so packages load like ordinary JavaScript — no async imports, no top-level await.
Typed buffers
A common WebBuf format and FixedBuf<N> give every package a shared, type-safe buffer surface.
Packages
Packages by family.
- Core buffers
- webbuf
- @webbuf/webbuf
- @webbuf/fixedbuf
- @webbuf/numbers
- @webbuf/rw
- @webbuf/base58
- @webbuf/bech32
- Hashing & KDF
- @webbuf/blake3
- @webbuf/sha256
- @webbuf/sha1
- @webbuf/ripemd160
- @webbuf/pbkdf2-sha256
- @webbuf/hkdf-sha256
- @webbuf/scrypt
- Elliptic curve
- @webbuf/rfc6979
- @webbuf/secp256k1
- @webbuf/bch-schnorr
- @webbuf/p256
- @webbuf/x25519
- @webbuf/ed25519
- Symmetric ciphers
- @webbuf/aescbc
- @webbuf/aesgcm
- Authenticated encryption
- @webbuf/acb3
- @webbuf/acs2
- Diffie-Hellman encryption
- @webbuf/acb3dh
- @webbuf/acb3p256dh
- @webbuf/acs2dh
- @webbuf/acs2p256dh
- @webbuf/aesgcm-p256dh
- Post-quantum primitives
- @webbuf/mlkem
- @webbuf/mldsa
- @webbuf/slhdsa
- Hybrid post-quantum
- @webbuf/aesgcm-mlkem
- @webbuf/aesgcm-p256dh-mlkem
- @webbuf/aesgcm-x25519dh-mlkem
- @webbuf/sig-ed25519-mldsa
Quick start
Install the umbrella package to get the core utilities.
bash
npm install webbuf