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 🙏

© 2025 – Pkg Stats / Ryan Hefner

murmur-hash

v2.0.0

Published

Fast MurmurHash3 with 128-bit support for Node.js and browsers

Readme

murmur-hash

MurmurHash3 for Node.js and browsers. Includes 32-bit and 128-bit variants.

Note: MurmurHash is non-cryptographic. Do not use for passwords, security tokens, or other sensitive data.

npm version CI License: MIT

Features

  • 32-bit and 128-bit hash outputs
  • x86 and x64 128-bit variants
  • Streaming API for large data
  • String and Uint8Array inputs
  • TypeScript definitions included
  • Zero dependencies

Installation

npm install murmur-hash

Quick Start

import { hash32, hash128, hash128x64 } from 'murmur-hash';

hash32('hello');       // 613153351
hash128('hello');      // '2360ae465e6336c6ad45b3f4ad45b3f4'
hash128x64('hello');   // 'cbd8a7b341bd9b025b1e906a48ae1d19'

API

hash32(input, seed?)

Returns a 32-bit unsigned integer.

hash32('hello')                   // 613153351
hash32('hello', 42)               // with seed
hash32(new Uint8Array([1,2,3]))   // binary input

hash128(input, options?)

Returns a 128-bit hash (x86 variant) as hex string or BigInt.

hash128('hello')                         // hex string
hash128('hello', { seed: 42 })           // with seed
hash128('hello', { output: 'bigint' })   // as BigInt

hash128x64(input, options?)

Returns a 128-bit hash (x64 variant) as hex string or BigInt.

hash128x64('hello')                         // hex string
hash128x64('hello', { seed: 42 })           // with seed
hash128x64('hello', { output: 'bigint' })   // as BigInt

Streaming

import { createHash32, createHash128, createHash128x64 } from 'murmur-hash';

const hasher = createHash32();
hasher.update('hello');
hasher.update(' world');
hasher.digest();  // same as hash32('hello world')

Types

type HashInput = string | Uint8Array;

interface Hash128Options {
  seed?: number;              // default: 0
  output?: 'hex' | 'bigint';  // default: 'hex'
}

Performance

Benchmarks on Apple M1 (ops/sec):

hash32     short string    2,000,000+
hash32     1KB bytes         560,000
hash128    short string      540,000
hash128    1KB bytes         350,000
hash128x64 short string      530,000
hash128x64 1KB bytes          35,000

Run locally: npm run bench

Migration from v1

The v1 API still works but is deprecated:

// v1 (deprecated)
import { v3 } from 'murmur-hash';
v3.x86.hash32('hello');

// v2
import { hash32 } from 'murmur-hash';
hash32('hello');

Requirements

Node.js 20+ or modern browsers (ES2020).

License

MIT