0.1.1 • Published 3 years ago

murmurhash-es v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

murmurhash-es

bundle size

ESM version of murmurhash v2 and v3

What is MurmurHash

MurmurHash is a non-cryptographic hash function created by Austin Appleby.

According to official website:

  • Extremely simple - compiles down to ~52 instructions on x86.

  • Excellent distribution - Passes chi-squared tests for practically all keysets & bucket sizes.

  • Excellent avalanche behavior - Maximum bias is under 0.5%.

  • Excellent collision resistance - Passes Bob Jenkin's frog.c torture-test. No collisions possible for 4-byte keys, no small (1- to 7-bit) differentials.

  • Excellent performance

Install

# yarn
yarn add murmurhash-es

# npm
npm i murmurhash-es
// ESM
import { murmurHashV2, murmurHashV3 } from 'murmurhash-es'

// CommonJS
const { murmurHashV2, murmurHashV3 } = require('murmurhash-es')

Compatiblity

Implementation is pure Javascript and using TextEncoder. Check compatibility.

License

MIT

Based on implementation from perezd/node-murmurhash and garycourt/murmurhash-js by Gary Court and Austin Appleby.