multiformats / multiformats/rust-multihash

Consider removing `MultihashDigest` and `Hasher` traits

Open
#285 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
166
Forks
63
PR merge metrics
No merged PRs in 30d

Description

Fundamentally, traits are meant for abstractions. If we don't create abstractions, the traits are not needed. As part of working on https://github.com/multiformats/rust-multihash/pull/272, it became apparent that the MultihashDigest and Hasher trait are never used for abstractions, only to enforce an interface.

We could change the multihash-derive crate from a custom derive to a proc-macro that just creates an impl block for us, based on API conventions of the various hashers.

If we want to stick to the traits, it would make more sense to develop a generic Codetable component that abstracts over the Hasher trait.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing pull request 272 and the multihash-derive crate, then trace how the MultihashDigest and Hasher traits are used. The issue presents two possible outcomes: replace the custom derive with a proc-macro that generates an impl block, or design a generic Codetable abstraction around Hasher; completion requires choosing and implementing one direction.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cryptography
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.