Merge pull request #39 from 67P/fix/ipfs-hash

Replaces the ipfsHash buffer with a B58 string
This commit is contained in:
Basti 2018-04-21 21:04:56 +02:00 committed by GitHub
commit 1779d66ee6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,9 +17,9 @@ class IPFS {
return data; return data;
} }
// merge ipfsHash (encoded from hashDigest, hashSize, hashFunction) // merge ipfsHash (encoded from hashDigest, hashSize, hashFunction)
data.ipfsHash = this.encodeHash(data); data.ipfsHash = multihashes.toB58String(this.encodeHash(data));
return this.cat(data) return this.cat(data.ipfsHash)
.then(deserialize) .then(deserialize)
.then((attributes) => { .then((attributes) => {
return Object.assign({}, data, attributes); return Object.assign({}, data, attributes);