murmur-numbers

0.0.2 • Public • Published

murmur-numbers

Simple fork of Gary Court's murmur3 implementation.

The only important difference is the inputs and outputs - instead of hashing text into a 32-bit integer, this version takes a series of integers, and divides the output into a float in the range [0..1) (i.e. same as Math.random).

Installation:

npm install --save murmur-numbers

Usage:

var seed = 12345
var hash = require('murmur-numbers')(seed)
 
hash(5)               // 0.4604153847321868
hash(0, 5)            // 0.585702647222206
hash(5, 0)            // 0.8242928483523428
hash(5) === hash(5)   // true

Readme

Keywords

none

Package Sidebar

Install

npm i murmur-numbers

Weekly Downloads

1

Version

0.0.2

License

MIT

Unpacked Size

2.19 kB

Total Files

3

Last publish

Collaborators

  • andyhall