hashpjw
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

node-hashpjw

NPM
Build Status Coverage Status

install

npm i hashpjw

simple

var hashpjw = require('hashpjw');
console.log(hashpjw("test") % 1000);

usage

var hashpjw = require('hashpjw');
var TBLMAX = 5;
var list = new Array(TBLMAX);
for(var i = 0; i<TBLMAX; ++i) list[i] = [];
var user1 = {
    "id" : "hogehoge123",
    "name" : "test1"
};
var user2 = {
    "id" : "ppppp123",
    "name" : "test2"
};
var idx1 = hashpjw(user1.id) % TBLMAX;
list[idx1].push(user1);
var idx2 = hashpjw(user2.id) % TBLMAX;
list[idx2].push(user2);
console.log(list);

Readme

Keywords

Package Sidebar

Install

npm i hashpjw

Weekly Downloads

1

Version

0.1.0

License

MIT

Unpacked Size

8.26 kB

Total Files

14

Last publish

Collaborators

  • you21979