Piotr Karwasz created CODEC-335:
-----------------------------------
Summary: Add generalized `gitBlob` and `gitTree` methods to
`DigestUtils`
Key: CODEC-335
URL: https://issues.apache.org/jira/browse/CODEC-335
Project: Commons Codec
Issue Type: New Feature
Reporter: Piotr Karwasz
The hashing algorithm used by Git's blob and tree object types is also
referenced in external standards such as [SWHID|https://www.swhid.org/], and is
useful for determining the canonical identity of an unpacked archive.
`DigestUtils` should expose this functionality directly.
*Proposal*
Add {{gitBlob}} and {{gitTree}} methods to {{DigestUtils}}, generalized to
support multiple hash algorithms: not only SHA-1 (currently used by Git), but
also future variants such as SHA-256 (as being introduced in [Git's ongoing
hash transition|https://git-scm.com/docs/hash-function-transition]).
*Motivation*
* The Git blob/tree hashing scheme is a well-defined, reusable algorithm beyond
Git itself.
* Several standards (e.g. SWHID) depend on it, making it a good candidate for a
shared utility.
* Generalizing over the hash algorithm future-proofs the implementation and
avoids a SHA-1-only API.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)