Skip to content
This repository has been archived by the owner on Aug 11, 2021. It is now read-only.

Commit

Permalink
feat: add defaultHashAlg
Browse files Browse the repository at this point in the history
  • Loading branch information
richardschneider committed Jun 24, 2018
1 parent 79da16c commit b7db79b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const CID = require('cids')
module.exports = {
resolver: {
multicodec: 'raw',
defaultHashAlg: 'sha2-256',
resolve: (binaryBlob, path, callback) => {
callback(null, {
value: binaryBlob,
Expand Down
4 changes: 4 additions & 0 deletions test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ describe('raw codec', () => {
expect(resolver.multicodec).to.equal('raw')
})

it('defaultHashAlg is sha2-256', () => {
expect(resolver.defaultHashAlg).to.equal('sha2-256')
})

it('resolver.resolve', () => {
resolver.resolve(testBlob, 'a/b/c/d', (err, result) => {
expect(err).to.not.exist()
Expand Down

0 comments on commit b7db79b

Please sign in to comment.