murmurhash
Sub-millisecond non-cryptographic string hashing for Node.js and the browser
Repository Health
Technical Analysis
murmurhash is a lightweight JavaScript port of the MurmurHash algorithms (v2 and v3), producing a fast, non-cryptographic 32-bit hash from any string and an optional seed. It runs identically in Node.js (as a CommonJS module) and in the browser via a plain script tag, making it a convenient drop-in for anywhere you need a quick, well-distributed numeric hash rather than cryptographic security.
The implementation is a direct port of Gary Court’s well-known murmurhash-js project, wrapped for CommonJS consumption, and ships with TypeScript type declarations. Because MurmurHash is designed for speed and good hash distribution rather than collision resistance against adversarial input, it’s best suited to internal-use cases like sharding, bucketing, or deduplication rather than security-sensitive hashing.
What You Get
- murmurhash.v2(string, seed) implementing the MurmurHash2 algorithm
- murmurhash.v3(string, seed) implementing the MurmurHash3 algorithm
- Works identically in Node.js (CommonJS require) and directly in the browser via a script tag
- Bundled TypeScript type declarations (murmurhash.d.ts)
- Zero runtime dependencies and a tiny (~4KB) source footprint
Common Use Cases
- Consistent-hashing based sharding or bucketing of keys across distributed caches or database partitions
- Deduplicating or fingerprinting large volumes of string data where cryptographic collision resistance isn’t required
- Generating stable, fast hash-based identifiers for client-side data structures like hash maps or bloom filters
- Load-balancing requests across backend nodes based on a hashed request attribute (e.g. session ID, IP)
Under The Hood
Architecture: The entire implementation lives in a single file, murmurhash.js, exposing a small object with v2 and v3 methods that each run a self-contained bitwise-mixing loop over the input string’s character codes combined with an optional seed, following the reference MurmurHash2/MurmurHash3 algorithms with no external state or configuration beyond the function arguments themselves.
Tech Stack: Written in plain JavaScript with no build step, no runtime dependencies, and a companion murmurhash.d.ts for TypeScript consumers; it’s published to npm as a CommonJS module and also usable unmodified as a browser <script> include, per the README’s dual installation instructions.
Code Quality: The codebase is intentionally tiny (~4KB, one main file), which limits the surface area for bugs; a minimal test.js exists but the project has been effectively unmaintained since 2024 (an inactive activity status per repository health signals), so users should verify the hash output against the reference algorithm for their specific use case before relying on it in new production code.
API Design: The two-function API (v2(str, seed) / v3(str, seed)) requires no setup, configuration objects, or class instantiation — call it and get a number back — which makes the learning curve effectively zero for anyone who already knows they want a MurmurHash value.
Used by 5 apps in this directory
Actual
Invoicing Finance
Local-first personal finance with envelope budgeting, end-to-end encryption, and multi-device sync — no subscription required.
Enso
Analytics · Data Engineering · Low Code Platforms
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.
Kibana
Analytics · Monitoring
Your open source window into the Elastic Stack — query, visualize, and act on data stored in Elasticsearch with real-time dashboards, AI-assisted search, and automated alerting.
Puter
File Storage · Developer Tools
A self-hostable, web-based internet OS with desktop GUI, cloud storage, AI drivers, and a developer SDK — all running in your browser.
Wire
Team Chat · Video Conferencing · Collaboration
Open source end-to-end encrypted messaging for teams and enterprises — self-host for complete control over your communications and data.