-
Notifications
You must be signed in to change notification settings - Fork 11
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
fix: dandi-etag carries extra component beyond md5 #24
Conversation
Codecov Report
@@ Coverage Diff @@
## master #24 +/- ##
==========================================
+ Coverage 93.93% 94.50% +0.57%
==========================================
Files 11 11
Lines 824 856 +32
==========================================
+ Hits 774 809 +35
+ Misses 50 47 -3
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
except (KeyError, ValueError): | ||
raise ValueError("Digest must have both valid dandi-etag and sha2-256.") | ||
digest = values[DigestType.dandi_etag] | ||
if "-" not in digest or len(digest.split("-")[0]) != 32: |
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.
I think
if "-" not in digest or len(digest.split("-")[0]) != 32: | |
if len(digest.split("-")[0]) != 32: |
would be sufficient but ok either way
Left minor non-consequential comment which might be wrong, so let's proceed |
The check for digest assumed an md5sum. however, the digest has an extra component and are of the form:
<md5sum>-<chunks>