Closed F1r3Hydr4nt closed 2 years ago
Qma1p2…
is the hash of a folder containing a file called letter2.jpg
, not of the file.
Therefore, when you hash the file's content, the hash differs.
The 2nd last line of the code reads the files data which is what is hashes though :/
I don't follow you! That file exists at that hash on the ipfs network I am merely trying to recreate the steps used to calculate that hash
The folder Qma1…
is not the same as the file Qma1…/letter2.jpg
.
You are reading the file QmS6…
which is also known as Qma1…/letter2.jpg
. The file QmS6…
is referenced in the folder Qma1…
as letter2.jpg
.
folder Qma1…
├ ─ ─ file "letter2.jpg" QmS6…
└ ─ ─ maybe some other files
Hey,
Thanks for the library, it's a damn complicated operation!
I had some problems even getting the 'hello world' example working (needed to wrap the operation in an async function) but in any case, I am now trying to get it to generate the ipfs of any random file from the network (a local copy) and have written this code but the hashes do not match when computed for some reason:
It is returning 'QmS6yhZGBATj6FmoNGniyZRXCSj3xzKkZfnxwAFoMdR5Sn' but as you can see in the file path this is incorrect :/
Might you have any idea what I could possibly be doing wrong?
Cheers