This repository has been archived by the owner on Feb 12, 2024. It is now read-only.
dag-cbor - number conversion different in go and js implementations? #1971
Labels
exp/expert
Having worked on the specific codebase is important
kind/bug
A bug in existing code (including security flaws)
kind/wontfix
P1
High: Likely tackled by core team if no one steps up
status/ready
Ready to be worked
OS: Mac OS X v10.14.3 (18D109).
Seems like the js and go implementations serialise numbers differently when using
dag
interface.Take the following json content:
and let's put it to IPFS using the following command:
Then the same content, but now using jsipfs with the help of the following script:
The output is:
zdpuB2H7FsgxU1PVuGcwk4TDYGgv7xrQ7naFJ1YHfRV71t7Rf
.Finally, when I try to reconstruct the CID myself using:
I get
zdpuB2H7FsgxU1PVuGcwk4TDYGgv7xrQ7naFJ1YHfRV71t7Rf
as well (so the same as viaipfs-http-client
).Now, if I change the content to be:
then all three methods return the same CID:
zdpuAqnunWR8B95ZbsDpCrHewXcVyRgixLwbThCdjZ37PCx8G
The text was updated successfully, but these errors were encountered: