Skip to content

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());
sha256Hash(buf: WebBuf): FixedBuf<32>

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.

Quick start

Install the umbrella package to get the core utilities.

bash
npm install webbuf
Read the docs