dwyl / cid

โ„๏ธcid ("content id") is a human-friendly (readable/typeable) unique ID function built for distributed/decentralised systems.
GNU General Public License v2.0
33 stars 3 forks source link

Please Test `Elixir` `cid` matches the output of `Go` and `Dart` version ๐Ÿงช #47

Closed nelsonic closed 10 months ago

nelsonic commented 10 months ago

We have an issue with the build failing for our imgup app because the cid (which is used as the filename) for the images uploaded to S3 has changed ... ๐Ÿ˜• We need to:

This is as easy as:

cd ~/code/cid
iex -S mix

iex(1)> Cid.cid("hello")
"bafkreibm6jg3ux5qumhcn2b3flc3tyu6dmlb4xa7u5bf44yegnrjhc4yeq"
LuchoTurtle commented 10 months ago

It's probably this line change:

https://github.com/dwyl/cid/commit/7c3e41bc9750ffbc31ae6b64f3f50ccfa6af928c

imgup is failing because the CID that is being created is becoming base58BTC instead of the previous base32

nelsonic commented 10 months ago

Indeed. base58 is preferable to base32 because it uses fewer characters to represent the same cid. ๐Ÿ’ญ

nelsonic commented 10 months ago

Lowering the priority of this in light of the fact that https://github.com/dwyl/imgup/pull/122 is merged and GitHub Workflow Status on main of imgup โœ…

We still want to confirm that cid created in Dart matches the one in Elixir. That is probably a T5m task if you have the project open on your Mac ...

LuchoTurtle commented 10 months ago

Running a locally created test on dart_cid yields a correct response:

      String input = 'hello';
      final output = CID.createCid(input, Multibase.base32).cid;

      expect(output == "bafkreibm6jg3ux5qumhcn2b3flc3tyu6dmlb4xa7u5bf44yegnrjhc4yeq", true);
00:01 +28: All tests passed!  
nelsonic commented 10 months ago

Cool. As long as they match we're all good. ๐Ÿ‘Œ ๐Ÿ™‡

LuchoTurtle commented 10 months ago

@nelsonic can't find the repo for the Go project. Where is it?

nelsonic commented 10 months ago

https://github.com/dwyl/cid/blob/b675c95d8b41cfb4331f19d0a9c239acfcd63739/.github/workflows/ci.yml#L14-L21