diff --git a/README.md b/README.md index 508f25d2f9..332884b31a 100644 --- a/README.md +++ b/README.md @@ -670,6 +670,7 @@ Aside from the default export, `ipfs` exports various types and utilities that a - [`multiaddr`](https://www.npmjs.com/package/multiaddr) - [`multibase`](https://www.npmjs.com/package/multibase) - [`multihash`](https://www.npmjs.com/package/multihash) +- [`multihashing`](https://github.com/multiformats/js-multihashing-async/) - [`multicodec`](https://www.npmjs.com/package/multicodec) - [`CID`](https://www.npmjs.com/package/cids) diff --git a/src/core/index.js b/src/core/index.js index 153f1a53cf..812043f7ca 100644 --- a/src/core/index.js +++ b/src/core/index.js @@ -11,6 +11,7 @@ const multihash = require('multihashes') const PeerBook = require('peer-book') const multibase = require('multibase') const multicodec = require('multicodec') +const multihashing = require('multihashing-async') const CID = require('cids') const debug = require('debug') const mergeOptions = require('merge-options') @@ -178,7 +179,7 @@ module.exports = IPFS // Note: We need to do this to force browserify to load the Buffer module const BufferImpl = Buffer -Object.assign(module.exports, { crypto, isIPFS, Buffer: BufferImpl, CID, multiaddr, multibase, multihash, multicodec, PeerId, PeerInfo }) +Object.assign(module.exports, { crypto, isIPFS, Buffer: BufferImpl, CID, multiaddr, multibase, multihash, multihashing, multicodec, PeerId, PeerInfo }) module.exports.createNode = (options) => { return new IPFS(options) diff --git a/test/core/exports.spec.js b/test/core/exports.spec.js index e1801be56d..4506dd8251 100644 --- a/test/core/exports.spec.js +++ b/test/core/exports.spec.js @@ -7,6 +7,7 @@ const CID = require('cids') const multiaddr = require('multiaddr') const multibase = require('multibase') const multihash = require('multihashes') +const multihashing = require('multihashing-async') const multicodec = require('multicodec') const PeerId = require('peer-id') const PeerInfo = require('peer-info') @@ -26,6 +27,7 @@ describe('exports', () => { expect(Ipfs.multiaddr).to.equal(multiaddr) expect(Ipfs.multibase).to.equal(multibase) expect(Ipfs.multihash).to.equal(multihash) + expect(Ipfs.multihashing).to.equal(multihashing) expect(Ipfs.multicodec).to.equal(multicodec) expect(Ipfs.PeerId).to.equal(PeerId) expect(Ipfs.PeerInfo).to.equal(PeerInfo)