multihashing-async
Advanced tools
Comparing version 0.7.0 to 0.8.0
@@ -0,1 +1,12 @@ | ||
<a name="0.8.0"></a> | ||
# [0.8.0](https://github.com/multiformats/js-multihashing-async/compare/v0.7.0...v0.8.0) (2019-09-12) | ||
### Bug Fixes | ||
* add identity hashing ([#53](https://github.com/multiformats/js-multihashing-async/issues/53)) ([3d4958e](https://github.com/multiformats/js-multihashing-async/commit/3d4958e)) | ||
* update deps and fix err-code usage ([fca09d6](https://github.com/multiformats/js-multihashing-async/commit/fca09d6)) | ||
<a name="0.7.0"></a> | ||
@@ -2,0 +13,0 @@ # [0.7.0](https://github.com/multiformats/js-multihashing-async/compare/v0.6.0...v0.7.0) (2019-04-16) |
{ | ||
"name": "multihashing-async", | ||
"version": "0.7.0", | ||
"version": "0.8.0", | ||
"description": "multiple hash functions", | ||
@@ -38,21 +38,22 @@ "keywords": [ | ||
"blakejs": "^1.1.0", | ||
"buffer": "^5.2.1", | ||
"err-code": "^1.1.2", | ||
"buffer": "^5.4.3", | ||
"err-code": "^2.0.0", | ||
"js-sha3": "~0.8.0", | ||
"multihashes": "~0.4.13", | ||
"multihashes": "~0.4.15", | ||
"murmurhash3js-revisited": "^3.0.0" | ||
}, | ||
"devDependencies": { | ||
"aegir": "^18.2.2", | ||
"aegir": "^20.1.0", | ||
"benchmark": "^2.1.4", | ||
"chai": "^4.1.2", | ||
"dirty-chai": "^2.0.1", | ||
"sinon": "^7.2.7" | ||
"sinon": "^7.3.2" | ||
}, | ||
"engines": { | ||
"node": ">=6.0.0", | ||
"npm": ">=3.0.0" | ||
"node": ">=10.0.0", | ||
"npm": ">=6.0.0" | ||
}, | ||
"contributors": [ | ||
"André Cruz <andremiguelcruz@msn.com>", | ||
"Arve Knudsen <arve.knudsen@gmail.com>", | ||
"David Dias <daviddias.p@gmail.com>", | ||
@@ -63,4 +64,6 @@ "David Dias <mail@daviddias.me>", | ||
"Harlan T Wood <harlantwood@users.noreply.github.com>", | ||
"Hugo Dias <hugomrdias@gmail.com>", | ||
"Hugo Dias <mail@hugodias.me>", | ||
"Hugo Dias <hugomrdias@gmail.com>", | ||
"Irakli Gozalishvili <contact@gozala.io>", | ||
"Jacob Heun <jacobheun@gmail.com>", | ||
"Juan Batiz-Benet <juan@benet.ai>", | ||
@@ -76,4 +79,5 @@ "Marcin Rataj <lidel@lidel.org>", | ||
"Volker Mische <volker.mische@gmail.com>", | ||
"dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>", | ||
"npm-to-cdn-bot (by Forbes Lindesay) <npmcdn-to-unpkg-bot@users.noreply.github.com>" | ||
] | ||
} |
@@ -24,2 +24,3 @@ 'use strict' | ||
// for other functions that do perform asynchronous work (see sha.browser.js) | ||
// eslint-disable-next-line | ||
const makeB2Hash = (size, hf) => async (data) => { | ||
@@ -26,0 +27,0 @@ const ctx = hf.init(size, null) |
@@ -12,2 +12,3 @@ 'use strict' | ||
// for other functions that do perform asynchronous work (see sha.browser.js) | ||
// eslint-disable-next-line | ||
const hash = (algorithm) => async (data) => { | ||
@@ -45,3 +46,6 @@ switch (algorithm) { | ||
const identity = data => Buffer.from(data) | ||
module.exports = { | ||
identity, | ||
sha1: sha('sha1'), | ||
@@ -48,0 +52,0 @@ sha2256: sha('sha2-256'), |
@@ -53,3 +53,3 @@ 'use strict' | ||
if (!alg) { | ||
throw errcode('hash algorithm must be specified', 'ERR_HASH_ALGORITHM_NOT_SPECIFIED') | ||
throw errcode(new Error('hash algorithm must be specified'), 'ERR_HASH_ALGORITHM_NOT_SPECIFIED') | ||
} | ||
@@ -59,3 +59,3 @@ | ||
if (!Multihashing.functions[alg]) { | ||
throw errcode(`multihash function '${alg}' not yet supported`, 'ERR_HASH_ALGORITHM_NOT_SUPPORTED') | ||
throw errcode(new Error(`multihash function '${alg}' not yet supported`), 'ERR_HASH_ALGORITHM_NOT_SUPPORTED') | ||
} | ||
@@ -71,2 +71,4 @@ | ||
Multihashing.functions = { | ||
// identity | ||
0x00: crypto.identity, | ||
// sha1 | ||
@@ -73,0 +75,0 @@ 0x11: crypto.sha1, |
@@ -7,2 +7,3 @@ 'use strict' | ||
// for other functions that do perform asynchronous work (see sha.browser.js) | ||
// eslint-disable-next-line | ||
module.exports = (algorithm) => async (data) => { | ||
@@ -9,0 +10,0 @@ switch (algorithm) { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
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
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
730263
5765
+ Addederr-code@2.0.3(transitive)
- Removederr-code@1.1.2(transitive)
Updatedbuffer@^5.4.3
Updatederr-code@^2.0.0
Updatedmultihashes@~0.4.15