hash-index
A function which will always return the same output given the same
input. The output is an integer in the range 0..n. By default n is
infinity-1, but another max value can be provided as an optional 2nd
argument.
The output is not guaranteed to be unique - only to be predictable based
on the input.


Installation
npm install hash-index
Usage
var hasher = require('hash-index')
hasher('bob')
hasher('alice')
hasher('bob')
hasher('alice')
Using the optional 2nd argument, you can supply an upper limit for the
returned hash value:
hasher('bob', 100)
hasher('alice', 100)
hasher('bob', 100)
hasher('alice', 100)
Input validation
If no max value is given, infinity-1 is used as the max value.
If max is less than 1 then NaN will be returned.
The input have to be either a non-empty string, a number or a non-empty
array. If not, NaN will be returned.
License
MIT