-
-
Notifications
You must be signed in to change notification settings - Fork 344
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
[PROPOSAL] Add download hash to Metadata #1703
Conversation
A few things:
{
"download_hash": {
"type": "sha256",
"digest": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
}
} Other than that looks good. |
Also, I was indifferent towards the casing of the digest but RFC 4648 specifies A-F for its alphabet so upper case is the way to go! |
And, I just realized you need the sha1 for the Internet Archive, so I'd recommend: "download_hash": [
{
"type": "sha1",
"digest": "1F4B3F21A77D4A302E3417A7C7A24A0B63740FC5"
},
{
"type": "sha256",
"digest": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855"
}
] |
0c2baff
to
cd6a38c
Compare
Having an array of hashes is a little more future proof as well. We can get the client to prefer stronger and fallback if in the future SHA256 is broken.
After writing it I figured 'FileService' is probably the place for such things, wasn't hard to merge it all. |
LGTM, just need to update |
@techman83 Sorry, I just realized, it would be easier to work with and more compact if we did: "download_hash": {
"sha1": "1F4B3F21A77D4A302E3417A7C7A24A0B63740FC5",
"sha256": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855"
} Then if we want the |
Yep, that's easier for me too. A little less awkward to build the object as well!
|
Schema updated and tested.
|
Closing this as the new changes go beyond just a 'download_hash'. |
Closing this as I assume @techman83 just forgot to actually do the deed. 😉 |
👯 |
NOTE Merging this will update all the current metadata on the next NetKAN-bot run. This is to aid in progressing #1682
@dbent - This is pretty much a duplicate of the DownloadSize Transformer. It generates a SHA1 of the downloaded file.
Tested on the redirect netkan
Produces
Which matches what I can produce with shasum
I'm not hugely tied to the field name or the method of generation if there are better suggestions.