[
https://issues.apache.org/jira/browse/CODEC-335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18069604#comment-18069604
]
Piotr Karwasz commented on CODEC-335:
-------------------------------------
There are still some edge cases that don't work in the code from PR #427:
symbolic links should be read as files, not redirected. I will fix it in a
follow-up PR.
> 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
> Priority: Minor
>
> 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)