Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit 0977839

Browse files
author
Alan Shaw
committed
refactor: encode using CID v1 base32 by default
License: MIT Signed-off-by: Alan Shaw <[email protected]>
1 parent 47e2b9e commit 0977839

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
"bs58": "^4.0.1",
9090
"byteman": "^1.3.5",
9191
"cid-tool": "~0.2.0",
92-
"cids": "~0.5.5",
92+
"cids": "github:ipld/js-cid#refactor/cidv1base32-default",
9393
"class-is": "^1.1.0",
9494
"datastore-core": "~0.6.0",
9595
"datastore-pubsub": "~0.1.1",

src/core/components/files-regular/add-pull-stream.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function prepareFile (file, self, opts, callback) {
2727
? cb(null, file)
2828
: self.object.get(file.multihash, Object.assign({}, opts, { preload: false }), cb),
2929
(node, cb) => {
30-
const b58Hash = cid.toBaseEncodedString()
30+
const cidStr = cid.toBaseEncodedString()
3131

3232
let size = node.size
3333

@@ -38,8 +38,8 @@ function prepareFile (file, self, opts, callback) {
3838
cb(null, {
3939
path: opts.wrapWithDirectory
4040
? file.path.substring(WRAPPER.length)
41-
: (file.path || b58Hash),
42-
hash: b58Hash,
41+
: (file.path || cidStr),
42+
hash: cidStr,
4343
size
4444
})
4545
}

0 commit comments

Comments
 (0)