-
Notifications
You must be signed in to change notification settings - Fork 8
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
Adding support for multiple checksum formats for create command #120
Conversation
1. Created HashPair to tie a hash string to a hash format 2. Created an aggregate hasher to output multiple hash strings 3. Created functions to create multiple hashes from file or data input 4. Added generator methods to append multiple file and directory hashes 5. Added FIXME comments in commands.py where the need to refactor is suspected
Fixed a bug that was supplying the wrong parameter to the aggregate data hashing method
The functions which generate format hashes can now operate with multiple hashes, however the command signature still needs to be updated to allow for multiple hashes to be supplied via the cli
- enabling multiple=True for -h command line option - adjusting methods in command.py - fixing small copy&paste issue (path vs file_path) - limitation: only works with "-n" option (without directory hashes)
Updated verify_directory_hash_subcommand to handle multiple hash formats Will pass verification if at least one format can be completely verified.
@mthudgins There is something weird going on in my tests with two hash formats: For example, when you remove the |
I look into this and get back to you
…On Mon, Mar 7, 2022 at 9:29 AM Patrick Renner ***@***.***> wrote:
@mthudgins <https://github.com/mthudgins> There is something weird going
on in my tests with two hash formats: For example, when you remove the -n
option in test_create_mulitple_hashformats, a c4 hasher tries to
interpret a md5 hash (and runs out of hex characters). I also tried to run
something similar on a folder with ascmhl create -v -h md5 -h sha1
/Users/ptr/Desktop/B002R2EC_temp which also failed. Is there a test that
invokes the directory hashing with multiple hash formats successfully? I
hope I didn't miss anything.
—
Reply to this email directly, view it on GitHub
<#120 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIWEAHIYJ4TRJET4Q4YTZTDU6YHDHANCNFSM5OVEG6CA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
Mark Hudgins
Lead Software Engineer
Imagine Products
|
added unit test for multiple hash creation when the -n argument is not supplied
Looks good now! I adjusted a few more tests for directory hashes to also check multiple hash formats and adjusted the stdout output a bit for a cleaner log. |
run test with "% pytest tests/test_create.py" (test might not work properly from within PyCharm etc. due to path issues to XSD)
hash generation now only generates non-specified existing hash formats if one is needed to benchmark verification
Looks good to me, ready to merge! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
final approval for adding support of multiple checksum formats
create
pass broken? #112