CC: | Ivan Shmakov <oneingray [...] gmail.com> |
Subject: | implement Digest::SHA::Combined |
Date: | Mon, 26 Mar 2012 16:04:15 +0700 |
To: | bug-Digest-SHA [...] rt.cpan.org |
From: | Ivan Shmakov <oneingray [...] gmail.com> |
For my application, I need to compute both SHA-256 and SHA-1
digests at the same time.
I've ended up writing a Digest::SHA::combined (which currently
lives embedded into [1]) wrapper package, which I feel may be
useful to the community, and now considering releasing it via
CPAN (as a public domain library.)
However, I wonder whether it could be considered for inclusion
into the Digest-SHA distribution instead?
TIA.
Background
Certain catalogues and protocols out there allow (or require)
one to list several digests for a single file (or, rather, an
octet sequence), provided that these are of different “kinds.”
Consider, e. g., the magnet: URI schema [2], or Debian's
“Package” database:
Package: beep
...
Filename: pool/main/b/beep/beep_1.2.2-22_amd64.deb
Size: 24036
MD5sum: dec6eb5a0eb38f4ac85e24d653c01916
SHA1: 15df36acc29d696c91cf432986e3bbd99761eada
SHA256: 869fc8d7d8e3d0cba191ea430e8a32426cc29efeb54e0b55af49c3fea90cddf0
Having a shortcut for such computations could simplify the code
dealing with those catalogues.
[1] http://gray.am-1.org/~ivan/archives/git/gitweb.cgi?p=fc-2012.git;a=blob;f=src/fc-scan.perl;h=2da2cb6845afdad3b696a2492a2b2a9d8fe3c8ac;hb=ebbe7f9576da3d8a2745f60001c80f93e02b0047
[2] http://en.wikipedia.org/wiki/Magnet_URI_scheme
--
FSF associate member #7257