3 ms·
Wouldn't it make sense to introduce a prefix to the hash for 256 bit hashs? For exemple a non hexa letter like z, so it becomes future proof and you can differe
by greatgib 4y ago
Wouldn't it make sense to introduce a prefix to the hash for 256 bit hashs? For exemple a non hexa letter like z, so it becomes future proof and you can differentiate with the prefix?
- orev 4y agoThe fact that this wasn’t done at the beginning is mind boggling. We already dealt with this problem with Unix passwords using crypt, which was solved exactly this way decades ago. This should be standard for any system using hash algorithms.
- layer8 4y agoHashes are binary values internally, so "z" (or it’s ASCII byte value) already exists as a prefix in SHA-1 hashes (any hash that begins with 7a). The real problem is that existing code assumes that hashes are always exactly 20 bytes in size, and any 20-byte value is a valid SHA-1 hash. There is no way to indicate a non-SHA-1 hash in the binary Git data formats and internal representations processed by existing code. The task is to change those formats and representations, and the related code, to enable such an indication.