hash-index:散列函数,返回具有可能最大值的整数

时间:2021-05-22 23:30:09
【文件属性】:
文件名称:hash-index:散列函数,返回具有可能最大值的整数
文件大小:4KB
文件格式:ZIP
更新时间:2021-05-22 23:30:09
JavaScript 散列索引 给定相同的输入,该函数将始终返回相同的输出。 输出是0..n范围内的整数。 默认情况下, n为无穷大-1,但可以提供另一个最大值作为可选的第二个参数。 不能保证输出是唯一的-只能根据输入是可预测的。 安装 npm install hash-index 用法 var hasher = require ( 'hash-index' ) // same input => same output hasher ( 'bob' ) // => 79268366047899 hasher ( 'alice' ) // => 90345298322240 hasher ( 'bob' ) // => 79268366047899 hasher ( 'alice' ) // => 90345298322240 使用可选的2nd参数,可以为返回的哈希值提供上限: hasher
【文件预览】:
hash-index-master
----.travis.yml(79B)
----index.js(807B)
----test.js(2KB)
----package.json(738B)
----LICENSE(1KB)
----.gitignore(535B)
----README.md(1KB)

网友评论