hash-wasm

Lightning-fast hash and password-derivation functions using hand-tuned WebAssembly binaries

Library
npm
v4.12.0
1,152stars

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
41/100Fair
Development Activity0
Maintenance20
Community44
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
77/100Good
Architecture78
Code Quality75
Innovation82
Learning Curve72

hash-wasm is a JavaScript/TypeScript library that computes a wide range of cryptographic and non-cryptographic hash functions — MD4/MD5, the SHA-1/2/3 families, Keccak, BLAKE2/BLAKE3, RIPEMD-160, xxHash, SM3, Whirlpool, Adler-32, and CRC32/CRC64 — plus password-hashing and key-derivation functions like Argon2, bcrypt, scrypt, and PBKDF2. Each algorithm is implemented as a hand-tuned WebAssembly binary rather than pure JavaScript, giving it significantly higher throughput than most JS-only hash libraries in both browsers and Node.js.

It exposes both simple one-shot functions and streaming/incremental hashing APIs, keeping bundle size per algorithm small since each hash ships as its own WASM module loaded on demand.

What You Get

  • One-shot hash functions (md5(), sha256(), blake3(), etc.) returning hex-encoded digests
  • Password/KDF functions: Argon2d/i/id, bcrypt, scrypt, and PBKDF2 with configurable cost parameters
  • Streaming/incremental hashing via a createXXX() instance for large or chunked input
  • HMAC support layered over any of the included hash algorithms
  • Per-algorithm WASM modules kept small (a few KB gzipped each) to minimize bundle impact

Common Use Cases

  • Client-side file integrity checks (computing a checksum before or after upload)
  • Password hashing with Argon2/bcrypt/scrypt in a Node.js authentication service
  • High-throughput data fingerprinting (dedup, caching keys) using fast non-cryptographic hashes like xxHash
  • Cross-platform code needing identical hash implementations in both the browser and Node.js

Under The Hood

Architecture hash-wasm’s lib/ directory contains one TypeScript wrapper per algorithm (md5.ts, sha256.ts, blake3.ts, argon2.ts, bcrypt.ts, scrypt.ts, etc.), each of which loads and drives a dedicated, hand-written WebAssembly binary (compiled from C, per the repo’s C/TypeScript language split) through a shared lockedCreate/mutex loading mechanism (lib/lockedCreate.ts, lib/mutex.ts) that manages async WASM instantiation and prevents concurrent-load races. A common index.ts re-exports every algorithm as a flat, tree-shakeable API.

Tech Stack Roughly 60% TypeScript / 40% hand-written C compiled to WebAssembly, published with UMD and ESM builds (dist/index.umd.js, dist/index.esm.js) and full .d.ts type declarations. Build tooling uses a custom scripts/build.sh to compile the C sources to WASM and bundle the TypeScript wrappers; linting runs via Biome.

Code Quality Tests run under Jest with --expose-gc --logHeapUsage and coverage tracked via Codecov, indicating attention to memory behavior given the WASM-heap interaction. However, the repository shows very low recent commit activity (health-score development_activity of 0) and only 3 contributors, with the last tagged release in late 2024 — a maintenance risk despite the code’s technical soundness.

API Design The API is deliberately minimal and consistent across all ~25 supported algorithms — call the matching async function or createXxx() instance — which makes it easy to swap algorithms without relearning the interface, and the per-algorithm module design keeps bundle size proportional only to the hashes actually used.

Used by 6 apps in this directory

TypeScript
63%
MIT

ALTCHA

Security

2,679

A self-hosted, privacy-first CAPTCHA alternative that uses memory-hard proof-of-work to stop bots without cookies, tracking, or third-party APIs.

View details
75
Repo Health
79
Technical
75
Dependency
Built with
TypeScript63%
Svelte29%
Updated today
Java
34%
Apache 2.0

Enso

Analytics · Data Engineering · Low Code Platforms

7,437

A visual and textual programming platform for data prep and analysis where the node graph and the underlying Enso code are always perfectly in sync, built by an Alteryx co-founder on a GraalVM engine.

View details
70
Repo Health
90
Technical
62
Dependency
Built with
Java34%
TypeScript27%
Scala26%
Updated 1 weeks ago
TypeScript
97%
MPL 2.0

Logto

Authentication

14,380

Open-source auth infrastructure for SaaS and AI apps with OIDC, SAML, and RBAC

View details
91
Repo Health
83
Technical
67
Dependency
Built with
TypeScript97%
Updated today
TypeScript
85%
GPL 3.0

Notesnook

Note Taking · File Storage · Security

14,433

End-to-end encrypted, open-source note-taking where your data stays yours — even from the server.

View details
91
Repo Health
84
Technical
66
Dependency
Built with
TypeScript85%
JavaScript12%
Updated today
Python
67%
Apache 2.0

Polar

Ecommerce · Developer Tools · Invoicing Finance

10,199

Open source payments infrastructure that turns software into a business — subscriptions, usage-based billing, digital products, and merchant-of-record compliance in one platform.

View details
90
Repo Health
82
Technical
71
Dependency
Built with
Python67%
TypeScript26%
Updated today
TypeScript
91%
MIT

Super Productivity

Productivity · Project Management

21,443

A privacy-respecting, local-first task manager with built-in timeboxing, Pomodoro timer, and deep integrations for Jira, GitHub, GitLab, and CalDAV — no accounts, no data collection, ever.

View details
90
Repo Health
81
Technical
73
Dependency
Built with
TypeScript91%
Updated 2 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search