0.0.5 • Published 9 years ago

chash v0.0.5

Weekly downloads
3
License
BSD
Repository
github
Last release
9 years ago

Build Status

node-chash

hash a value to a consistent number within a specified range. in goes key out goes number that's it.

example

var chash = require('chash');

var colors = ['red','blue','green','purple']
, bobscolor = chash('bob',colors.length)
, ryanscolor = chash('ryan',colors.length)
, suescolor = chash('sue',colors.length)
;

console.log('bob will always be',colors[bobscolor]);
console.log('ryan will always be',colors[ryanscolor]);
console.log('sue will always be',colors[suescolor]);

notes

random distribution

?_?

0.0.5

9 years ago

0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

12 years ago

0.0.0

12 years ago