Skip to content

Commit

Permalink
fix: support CIDv1 as input
Browse files Browse the repository at this point in the history
This fixes issue described in
ensdomains/ui#46 (comment)
  • Loading branch information
lidel committed Sep 15, 2020
1 parent 26d97b0 commit db40f6a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/profiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ const encodes = {
* @return {Buffer}
*/
ipfs: (value) => {
const multihash = multiH.fromB58String(value);
return new CID(1, 'dag-pb', multihash).buffer;
return new CID(value).toV1().buffer;
},
/**
* @param {string} value
Expand Down Expand Up @@ -117,4 +116,4 @@ const profiles = {
};

exports.hexStringToBuffer = hexStringToBuffer;
exports.profiles = profiles;
exports.profiles = profiles;

0 comments on commit db40f6a

Please sign in to comment.