A javascript implementation of MurmurHash3 algorithms.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib/v3
test
.gitignore
.npmignore
LICENSE
README.md
index.js
package.json

README.md

Murmur Hash (v3)

A javascript implementation of MurmurHash3's hashing algorithms.

Installation

$ npm install murmur-hash

Usage

var murmurHash3 = require('murmur-hash').v3;

Examples

// Return a 32bit hash as a unsigned int:
> murmurHash3.x86.hash32("I will not buy this record, it is scratched.")
  2832214938

// Return a 128bit hash as a unsigned hex:
> murmurHash3.x86.hash128("I will not buy this tobacconist's, it is scratched.")
  "9b5b7ba2ef3f7866889adeaf00f3f98e"
> murmurHash3.x64.hash128("I will not buy this tobacconist's, it is scratched.")
  "d30654abbd8227e367d73523f0079673"

// Specify a seed (defaults to 0):
> murmurHash3.x86.hash32("My hovercraft is full of eels.", 25)
  2520298415