Skip to content
This repository has been archived by the owner on Mar 15, 2021. It is now read-only.

RFC0013: Multihash #26

Merged
merged 3 commits into from
Sep 5, 2018
Merged

RFC0013: Multihash #26

merged 3 commits into from
Sep 5, 2018

Conversation

arnau
Copy link
Contributor

@arnau arnau commented Aug 13, 2018

Context

Currently we use a custom sha-256: prefix for stringified hexadecimal hashes to qualify them as SHA256. With this approach parsers must be done specifically for registers and registers must standarise as many hashing algorithms as needed by users.

Changes proposed in this pull request

This RFC proposes to change the method to qualify hashes from using prefixes
sha-256: to using Multihash which is becoming a standard.

Guidance to review

Check it is consistent.


The proposal is to adopt [Multihash](https://multiformats.io/multihash/).
Their specification is quite thorough but the gist is to replace any of our
`sha-256:` to `1220`. `0x12` for the hashing function sha2-256 and `0x20` for

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This confused me initially as I didn't realise you actually return the hex representation of the bytes as a string. I think you could leave out the hex representation here and just say "12" and "20".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Umm, I see your point, I would like a way to express it such that it's clear 12 is in hex and not base 10 or something else. Any ideas?

Arnau Siches added 3 commits September 5, 2018 09:04
Signed-off-by: Arnau Siches <arnau.siches@digital.cabinet-office.gov.uk>
Signed-off-by: Arnau Siches <arnau.siches@digital.cabinet-office.gov.uk>
Signed-off-by: Arnau Siches <arnau.siches@digital.cabinet-office.gov.uk>
@arnau arnau merged commit 96ef483 into master Sep 5, 2018
arnau pushed a commit that referenced this pull request Sep 5, 2018
@arnau arnau deleted the multihash branch September 5, 2018 08:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants