tus-resumable-upload-protocol icon indicating copy to clipboard operation
tus-resumable-upload-protocol copied to clipboard

how does tus name checksums?

Open nigoroll opened this issue 5 years ago • 9 comments

Ref https://github.com/tus/tus-resumable-upload-protocol/blob/master/protocol.md#checksum

This question might sound picky, but would it not make sense for tus to define how checksums are named or refer to a 3rd party for that definition? A clarification has already been added that names of hashes are in lower case, yet for example it is unclear to me if SHA3-224 would be called sha3_224, sha3-224 or even differently.

nigoroll avatar Jun 22 '20 17:06 nigoroll

Good point! There are no strict rules since this question has never arisen but in your particular case, I would stick to the rule of making it lowercase. So SHA3-224 becomes sha3-224.

Acconut avatar Jun 24 '20 10:06 Acconut

sure, that would work. But I wonder if the project should have a simple registry (need not be more than a file with hash name identifiers)?

nigoroll avatar Jun 24 '20 11:06 nigoroll

I don't think we need a complete registry where we are required to keep up with the latest hashing algorithms. But maybe we can add a few more naming examples to the spec, that cover most naming conventions. What do you think?

Acconut avatar Jul 01 '20 17:07 Acconut

I still think that a simple registry would leave the least amount of slack at very low overhead.

nigoroll avatar Jul 15 '20 15:07 nigoroll

I still disagree :) There are continuously new checksum algorithms added, which come in many variations. So, in some point of time, the registry would be outdated and we would be forced to always update it. I dislike the idea of having a registry which will be incomplete in some time. I think offering a generic approach to naming checksums is better.

Acconut avatar Aug 21 '20 09:08 Acconut

I don't disagree with naming rules. But they still leave room for interpretation.

I just found the iana hash function textual names registry, which, unfortunately, does not have that many entries. So maybe we could have something like

  • if the algorithm is in the registry, use that name
  • otherwise, follow this naming convention

nigoroll avatar Aug 21 '20 09:08 nigoroll

Can you provide a few examples which would "leave room for interpretation"? Please don't take this as an offense, I am just not sure what variety of naming we have to deal with.

Acconut avatar Aug 31 '20 09:08 Acconut

room for interpretation examples: sha3-256 vs. sha-3-256 vs sha3_256 vs. sha_3_256 etc.

nigoroll avatar Sep 06 '20 16:09 nigoroll

If you feel so strongly about this, please open a PR with your idea so we can understand what your concrete proposal is like.

Acconut avatar Sep 07 '20 09:09 Acconut