Open tertsdiepraam opened 1 year ago
I have changed my mind a bit. hashsum
is still unnecessary and we need to remove it. cksum
will first need to get feature parity and then we can start changing things up.
So here's my plan:
cksum
a bit to become a bit of a better version of the current hashsum.uucore::sum
module to a crate multisum
. The idea of this crate is to provide a common interface to many summing algorithms, which might be helpful for other projects too.cksum
in a subdirectory of uu
.So something like this:
uu/
-- cksum/
-- Cargo.toml
-- src/
-- common.rs
-- b2sum.rs
-- cksum.rs
-- sum.rs
-- etc.
I'm not sure that this exact structure will work, but I think it's gotta be something close to this.
After https://github.com/uutils/coreutils/pull/4356, the combined
hashsum
binary will no longer be necessary. Still, all the hashing utilities will be based onhashsum
, so my suggestion is to refactor thehashsum
crate so that it defines multiple binaries, each with their ownmain
function. We can then remove the multi-call logic and simplify the code, because theDigest
type for each binary will be statically defined.