refactor: Rework module and feature flag for better v4/v4.2 split #13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In order to avoid feature flag resolution issues, I've gone and reworked the structure of the project to split the two implementations into separate modules. By default for v0.2 of this crate, going forward the chosen implementation will be Final v4.2, which is meant to be more robust. The legacy final v4 will be behind a feature flag
legacy_v4
, but enabling that will only expose the module, no longer overriding the implementation output.To prevent misuse of certain features such as secret generation, I reworked the methods to output structs instead of plain arrays, allowing me to type into the methods that the hashers can only be seeded with the correct secrets type, so you can't use the legacy version to seed the secret of the default hasher.
I'm sure there can be some further deduplication done, but I cba for this part, and probably could be done as a follow-up should there be the need for it.
Closes #10