npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

whatsapp-rust-bridge-baron

v1.0.2

Published

A high-performance utilities for WhatsApp, powered by Rust and WebAssembly.

Readme

whatsapp-rust-bridge

High-performance WhatsApp utilities powered by Rust — available as WebAssembly (Node.js / browser), native C library, and Java/JNI (Android / JVM).

┌─────────────────────────────────────────────────────┐
│                   Rust core (src/)                  │
│  crypto · curve25519 · signal · binary · noise · voip│
└──────────┬─────────────────┬───────────────┬────────┘
           │                 │               │
     wasm32 target      cdylib target   cdylib + jni
           │                 │               │
    ┌──────▼──────┐  ┌───────▼──────┐ ┌─────▼──────┐
    │ TypeScript  │  │      C       │ │  Java/JNI  │
    │  (Node.js)  │  │  (.h + .dll) │ │ (.java)    │
    └─────────────┘  └──────────────┘ └────────────┘

Features

| Feature | Status | |---|---| | Binary protocol (encode / decode) | ✅ | | Curve25519 (DH, sign, verify) | ✅ | | AES-256-GCM / CBC / CTR | ✅ | | HMAC-SHA256 / SHA-256 / MD5 / HKDF | ✅ | | LibSignal (session, pre-keys, group cipher) | ✅ | | App State Sync (LTHash, patch/snapshot MAC) | ✅ | | Noise handshake (XX + IK + XXfallback) | ✅ | | JID parse / encode / inspect / construct | ✅ | | VoIP — MLow audio codec (encode / decode) | ✅ | | VoIP — E2E SRTP media pipeline (protect / unprotect) | ✅ | | VoIP — sans-io CallEngine (signaling + media driver) | ✅ | | Audio (waveform, duration) | ✅ (optional feature) | | Image (thumbnails, conversion) | ✅ (optional feature) | | Sticker metadata (WebP EXIF) | ✅ (optional feature) |

Bridges

| Target | Entry point | Docs | |---|---|---| | TypeScript / Node.js | dist/index.js | docs/usage-typescript.md | | C / C++ | native/include/whatsapp_bridge.h | docs/usage-c.md | | Java / Kotlin / Android | native/java/com/whatsapp/bridge/ | docs/usage-java.md |

Build

# All three targets (release)
.\build-all.ps1

# Individual targets
.\build-all.ps1 -SkipC -SkipJni     # WASM + TypeScript only
.\build-all.ps1 -SkipWasm           # C + JNI only
.\build-all.ps1 -SkipWasm -SkipJni  # C only
.\build-all.ps1 -SkipWasm -SkipC    # JNI only

# Cross-compile
.\build-all.ps1 -Target aarch64-unknown-linux-gnu

See docs/building.md for full build instructions and cross-compilation targets.

Quick Start

TypeScript / Node.js

const { generateKeyPair, aesEncryptGCM, sha256 } = require("whatsapp-rust-bridge-baron");

const kp   = generateKeyPair();
const hash = sha256(Buffer.from("hello"));

C

#include "native/include/whatsapp_bridge.h"

uint8_t pub[33], priv[32];
wa_generate_key_pair(pub, priv);

Java

NativeLoader.load();
byte[] kp = Curve.generateKeyPair();

Project layout

whatsapp-rust-bridge/
├── src/                  Rust source — WASM build (wasm-bindgen)
│   ├── crypto.rs         AES, HMAC, HKDF, SHA-256, MD5
│   ├── curve.rs          Curve25519 keygen, DH, sign, verify
│   ├── binary.rs         WhatsApp binary protocol (encode/decode)
│   ├── jid.rs            JID parse/encode/construct/inspect
│   ├── noise_session.rs  Noise XX, IK, XXfallback handshake + framing
│   ├── session_builder.rs / session_cipher.rs   Signal 1-to-1
│   ├── group_cipher.rs   Signal group messaging
│   ├── key_helper.rs     Pre-key / signed-pre-key / registration ID
│   ├── appstate.rs       App-state sync, LTHash, MACs
│   ├── voip.rs           Calls: MLow codec, E2E SRTP, sans-io CallEngine
│   ├── storage_adapter.rs  JS ↔ Signal storage bridge
│   ├── audio.rs          Waveform + duration (feature = audio)
│   ├── image_utils.rs    Thumbnails (feature = image)
│   └── sticker_metadata.rs  WebP EXIF (feature = sticker)
├── internal/             Self-contained protocol crates
│   ├── wacore            Full WhatsApp core + VoIP engine (vendored; client
│   │                     parts unused, voip exposed via src/voip.rs)
│   ├── wacore/appstate   Key expansion, LTHash, patch encode/decode
│   ├── wacore/binary     Binary protocol, JID types, token maps
│   ├── wacore/libsignal  Signal protocol (sessions, group, ratchet)
│   ├── wacore/noise      Noise XX/IK/XXfallback, frame codec
│   ├── wacore/derive     Proc-macro helpers
│   └── waproto           Protobuf definitions (WA 2.3000.x) + tags + codec
├── native/               Native C + JNI build
│   ├── src/ffi/          C-ABI exports (wa_* functions)
│   ├── src/jni_bridge/   JNI exports (Java_* symbols)
│   ├── java/             Java wrapper classes + NativeLoader
│   └── include/          whatsapp_bridge.h
├── ts/                   TypeScript entry point + macro
├── dist/                 TypeScript compiled output
├── pkg/                  wasm-pack output (WASM + JS glue + .d.ts)
├── test/                 Bun tests
├── build-all.ps1         Master build script (WASM + C + JNI)
└── docs/                 Extended documentation

License

MIT