【文件属性】:
文件名称:consistent-hashing:一致哈希的简单JavaScript实现
文件大小:5KB
文件格式:ZIP
更新时间:2021-05-14 07:33:37
JavaScript
一致的散列
这是一致性哈希的简单JavaScript实现。 有关一致性哈希的更多信息,请参见。
安装
使用以下命令安装依赖项:
$ npm install
用法
var ConsistentHashing = require ( './consistent_hashing' ) ;
var nodeNames = [ 'node1' , 'node2' , 'node3' , 'node4' , 'node5' , 'node6' ] ;
var replicaCount = 100 ;
var cons = new ConsistentHashing ( nodeNames , replicaCount ) ;
var chars = [
'A' , 'B' , 'C' , 'D' , 'E' , 'F' , 'G' , 'H' , 'I' ,
'J' , 'K' , 'L'
【文件预览】:
consistent-hashing-master
----index.js(50B)
----.jscsrc(24B)
----package.json(594B)
----test()
--------index.js(2KB)
----LICENSE(1KB)
----example.js(516B)
----.gitignore(14B)
----README.md(947B)
----.jshintrc(117B)
----consistent_hashing.js(2KB)