Robert Francis

Results 98 comments of Robert Francis

@nelsonic Upon further inspection, the `Multihas.Util/sum/2` function just ends up calling `Multihash.encode/3` with a hash_type of `:sha1`, `:sha2_256`, `:sha2_512`. This is probably the reason that they did not include the...

It seems that when we upload a small file to IPFS in version1 with the "raw" codec it doesn't manipulate the data. This can be seen with the following... ```...

@nelsonic based on [this comment](https://github.com/dwyl/cid/issues/11#issuecomment-456951905) maybe we could make a start with... ```elixir %CID{ codec: "raw", multihash: >, version: 1 } ``` And see if we can get the same...

@nelsonic > figure out how to use https://github.com/multiformats/ex_multihash to hash content. The code below is a modified version of the current `Cid.make/2`. It can be tidied and the variables can...

@nelsonic I am up for diving deep 💯, but just want to be clear on what you mean by CID function. Do you mean that [this](https://github.com/dwyl/cid#installation) example in the readme...

```node const CID = require('../src') const multihashing = require('multihashing-async') const buffer = Buffer.from('Hello World\n') multihashing(buffer, 'sha2-256', (err, mh) => { const cid = new CID(1, 'raw', mh) console.log(cid.toBaseEncodedString()) }) zb2rhkpbfTBtUV1ESqSScrUre8Hh77fhCKDLmX21rCo5xp8J9...

JS implementation ```node const aObj = { a: "a" } const json_a = JSON.stringify(aObj) console.log(json_a); const buffer2 = Buffer.from(json_a) multihashing(buffer2, 'sha2-256', (err, mh) => { const cid = new CID(1,...

elixir implementation ```elixir iex(1)> map = %{a: "a"} %{a: "a"} iex(2)> json = Jason.encode!(map) "{\"a\":\"a\"}" iex(3)> digest = :crypto.hash(:sha256, json) iex(4)> {:ok, multihash} = Multihash.encode(:sha2_256, digest) iex(5)> cid = CID.cid!(multihash,...

Both CIDs appear to be the same 👍 🎉 Going to try and recreate this with IPFS now

IPFS implementation ``` $ echo "{\"a\":\"a\"}" | ipfs add --cid-version 1 added zb2rhbYzyUJP6euwn89vAstfgG2Au9BSwkFGUJkbujWztZWjZ zb2rhbYzyUJP6euwn89vAstfgG2Au9BSwkFGUJkbujWztZWjZ ``` This CID is different. Not sure why at the moment. Looking to this in more...