rust-multihash
rust-multihash copied to clipboard
Consider removing `MultihashDigest` and `Hasher` traits
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.