Comparing version 1.2.9 to 1.2.10
84
index.js
@@ -8,44 +8,44 @@ /** | ||
var BigInteger = require('jsbn'), | ||
version = '1a', | ||
referenceSeed = 'chongo <Landon Curt Noll> /\\../\\', | ||
defaultKeyspace = 52, | ||
fnvConstants = { | ||
32: { | ||
prime: Math.pow(2, 24) + Math.pow(2, 8) + 0x93, | ||
offset: 0, | ||
}, | ||
52: { | ||
// the 52-bit FNV prime happens to be the same as the 64-bit prime, | ||
// since it only uses 40 bits. | ||
prime: parseInt(bn(2).pow(bn(40)).add(bn(2).pow(bn(8))).add(bn('b3', 16)), 10), | ||
offset: 0, | ||
mask: bn('FFFFFFFFFFFFF', 16) | ||
}, | ||
64: { | ||
prime: bn(2).pow(bn(40)).add(bn(2).pow(bn(8))).add(bn('b3', 16)), | ||
offset: 0, | ||
mask: bn('FFFFFFFFFFFFFFFF', 16) | ||
}, | ||
128: { | ||
prime: bn(2).pow(bn(88)).add(bn(2).pow(bn(8))).add(bn('3b', 16)), | ||
offset: 0, | ||
mask: bn('FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF', 16) | ||
}, | ||
256: { | ||
prime: bn(2).pow(bn(168)).add(bn(2).pow(bn(8))).add(bn('63', 16)), | ||
offset: 0, | ||
mask: bn('FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF', 16) | ||
}, | ||
512: { | ||
prime: bn(2).pow(bn(344)).add(bn(2).pow(bn(8))).add(bn('57', 16)), | ||
offset: 0, | ||
mask: bn('FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF', 16) | ||
}, | ||
1024: { | ||
prime: bn(2).pow(bn(680)).add(bn(2).pow(bn(8))).add(bn('8d', 16)), | ||
offset: 0, | ||
mask: bn('FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF', 16) | ||
} | ||
}; | ||
var BigInteger = require('jsbn'); | ||
var version = '1a'; | ||
var referenceSeed = 'chongo <Landon Curt Noll> /\\../\\'; | ||
var defaultKeyspace = 52; | ||
var fnvConstants = { | ||
32: { | ||
prime: Math.pow(2, 24) + Math.pow(2, 8) + 0x93, | ||
offset: 0, | ||
}, | ||
52: { | ||
// the 52-bit FNV prime happens to be the same as the 64-bit prime, | ||
// since it only uses 40 bits. | ||
prime: parseInt(bn(2).pow(bn(40)).add(bn(2).pow(bn(8))).add(bn('b3', 16)), 10), | ||
offset: 0, | ||
mask: bn('FFFFFFFFFFFFF', 16) | ||
}, | ||
64: { | ||
prime: bn(2).pow(bn(40)).add(bn(2).pow(bn(8))).add(bn('b3', 16)), | ||
offset: 0, | ||
mask: bn('FFFFFFFFFFFFFFFF', 16) | ||
}, | ||
128: { | ||
prime: bn(2).pow(bn(88)).add(bn(2).pow(bn(8))).add(bn('3b', 16)), | ||
offset: 0, | ||
mask: bn('FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF', 16) | ||
}, | ||
256: { | ||
prime: bn(2).pow(bn(168)).add(bn(2).pow(bn(8))).add(bn('63', 16)), | ||
offset: 0, | ||
mask: bn('FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF', 16) | ||
}, | ||
512: { | ||
prime: bn(2).pow(bn(344)).add(bn(2).pow(bn(8))).add(bn('57', 16)), | ||
offset: 0, | ||
mask: bn('FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF', 16) | ||
}, | ||
1024: { | ||
prime: bn(2).pow(bn(680)).add(bn(2).pow(bn(8))).add(bn('8d', 16)), | ||
offset: 0, | ||
mask: bn('FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF', 16) | ||
} | ||
}; | ||
@@ -52,0 +52,0 @@ /** |
{ | ||
"name": "fnv-plus", | ||
"version": "1.2.9", | ||
"version": "1.2.10", | ||
"description": "Javascript FNV-1a Hashing Algorithm up to 1024 bits, with highly optimized 32bit and 52bit implementations.", | ||
@@ -10,7 +10,9 @@ "main": "index.js", | ||
"devDependencies": { | ||
"chai": "~1.8.1", | ||
"mocha": "~1.14.0" | ||
}, | ||
"bundledDependencies": [ | ||
"jsbn" | ||
], | ||
"scripts": { | ||
"test": "mocha -R spec spec/" | ||
"test": "mocha --reporter spec" | ||
}, | ||
@@ -22,2 +24,4 @@ "repository": { | ||
"keywords": [ | ||
"id", | ||
"unique", | ||
"hash", | ||
@@ -29,9 +33,8 @@ "checksum", | ||
"uniqueness", | ||
"tuple space", | ||
"bloom", | ||
"filter" | ||
], | ||
"author": "Travis Webb", | ||
"author": "Travis Webb <me@traviswebb.com>", | ||
"license": "MIT", | ||
"readmeFilename": "README.md", | ||
"gitHead": "227465ef7340e0087901ad50643266896fa96021", | ||
"bugs": { | ||
@@ -38,0 +41,0 @@ "url": "https://github.com/tjwebb/fnv-plus/issues" |
@@ -29,4 +29,3 @@ fnv-plus | ||
##### New in 1.2.x | ||
- You can easily define custom seeds. Most other fnv implementations hardcode | ||
the fnv offset. | ||
- You can easily define custom seeds. | ||
- the `hash()` function can now take arbitrary Javascript objects as input. | ||
@@ -55,3 +54,3 @@ - changed default bitlength to **52** | ||
fnv.seed('fobar testseed'); | ||
fnv.seed('foobar testseed'); | ||
assert.notEqual(fnv.hash(astring), ahash64); | ||
@@ -72,3 +71,3 @@ // ^^ because the default seed is not 'foobar testseed' | ||
generator). | ||
- default seed is the URL of this repository | ||
- default seed is `chongo <Landon Curt Noll> /\>./\\` | ||
@@ -87,7 +86,7 @@ #### `FnvHash.str()` | ||
[npm-image]: https://img.shields.io/npm/v/fnv-plus.svg?style=flat | ||
[npm-image]: https://img.shields.io/npm/v/fnv-plus.svg?style=flat-square | ||
[npm-url]: https://npmjs.org/package/fnv-plus | ||
[travis-image]: https://img.shields.io/travis/tjwebb/fnv-plus.svg?style=flat | ||
[travis-image]: https://img.shields.io/travis/tjwebb/fnv-plus.svg?style=flat-square | ||
[travis-url]: https://travis-ci.org/tjwebb/fnv-plus | ||
[daviddm-image]: http://img.shields.io/david/tjwebb/fnv-plux.svg?style=flat | ||
[daviddm-image]: http://img.shields.io/david/tjwebb/fnv-plux.svg?style=flat-square | ||
[daviddm-url]: https://david-dm.org/tjwebb/fnv-plus |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
69965
1
12
1704
89
1