Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-call hashsum binary is no longer necessary #4414

Open
tertsdiepraam opened this issue Feb 22, 2023 · 1 comment
Open

Multi-call hashsum binary is no longer necessary #4414

tertsdiepraam opened this issue Feb 22, 2023 · 1 comment

Comments

@tertsdiepraam
Copy link
Member

After #4356, the combined hashsum binary will no longer be necessary. Still, all the hashing utilities will be based on hashsum, so my suggestion is to refactor the hashsum crate so that it defines multiple binaries, each with their own main function. We can then remove the multi-call logic and simplify the code, because the Digest type for each binary will be statically defined.

@tertsdiepraam
Copy link
Member Author

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:

  1. Update cksum a bit to become a bit of a better version of the current hashsum.
  2. I want to extract the 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.
  3. Create a module for the common functionality based on the updated cksum in a subdirectory of uu.
  4. In that same subdirectory, we define all utils.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant