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

Feature to remember successful hash algorithm when checking file #256

Open
sjb2024 opened this issue Jan 13, 2024 · 0 comments
Open

Feature to remember successful hash algorithm when checking file #256

sjb2024 opened this issue Jan 13, 2024 · 0 comments
Labels

Comments

@sjb2024
Copy link

sjb2024 commented Jan 13, 2024

Hi there. In version 1.4.1, you added a feature to "speed up" verification by detecting the hash algorithm from filenames.

Given that it's most common for the hashes in a file to come from a single algorithm (e.g., because the checkfile is output from singular program like sha256sum, sha512sum, or rhash itself with a single hash), a similar way to "speed up" verification in practice would be to provide an option (or perhaps even make it the default) to "learn," in each separate run of rhash -c, which algorithm has been successful for a checkfile and remember that for the remainder of the run. I don't mean that anything should persist past the run of rhash -c, just that internally rhash favor hash algorithms that have previously succeeded for a given checkfile.

I think the ideal behavior might be simply to reorder the default search order of the hashing algorithms so that the previously successful one(s) are tried first, given a hash of a particular length to be verified in a checkfile; this should do no harm and speed up verification in the most common case.

Perhaps it would also be useful to provide an option that requires hashes within a checkfile to come consistently from the same source, whatever it might be, but I'm not sure how often that would be used. Still, I would use such an option over the current default behavior (given that I have many checkfiles that (1) do not always carry useful names but (2) contain long lists of hashes, all from the same algorithm). The only alternative, if I want optimal performance, is to figure out what the hashes are myself and then supply that algorithm to rhash manually.

Thanks for considering this feature request.

@sjb2024 sjb2024 changed the title Feature to remember successful hash algorithm when processing file Feature to remember successful hash algorithm when checking file Jan 13, 2024
@rhash rhash added the FR label Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants