Split out a new `Base` from `HashFormat`
Motivation
This allows for better separation of concerns, and will allow better modeling of some things.
Context
Depends on #14720
I am not sure whether the *Display functions, to preserve existing behavior, are worth it!
Add :+1: to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.
This allows for better separation of concerns, and will allow better modeling of some things.
Sorry but the motivation has to be stronger than "better separation of concerns" (what concerns? what things do we want to model better?). This isn't Haskell, we don't need to model everything in the type system.
I can't really see how writing std::holds_alternative<HashFormatSRI>(hf->raw) is in any way preferable to hf == nix::HashFormat::SRI.
"Base encoding" doesn't feel like a correct term. We're not encoding a base here, we're encoding a hash.
:tada: All dependencies have been resolved !
If we're not doing structured JSON formats for hash, that removes one of the immediate needs I had for this. Drafting, accordingly.