• Perl module Digest::SHA256 and Debian package libdigest-sha-perl

    From David Christensen@21:1/5 to All on Thu Apr 3 01:10:01 2025
    debian-user:

    I would like to use the Perl module Digest::SHA256 on Debian:

    2025-04-02 15:57:50 root@laalaa ~
    # cat /etc/debian_version ; uname -a
    11.11
    Linux laalaa 5.10.0-34-amd64 #1 SMP Debian 5.10.234-1 (2025-02-24)
    x86_64 GNU/Linux

    2025-04-02 15:58:20 root@laalaa ~
    # perl -v

    This is perl 5, version 32, subversion 1 (v5.32.1) built for x86_64-linux-gnu-thread-multi
    (with 56 registered patches, see perl -V for more detail)

    Copyright 1987-2021, Larry Wall

    Perl may be copied only under the terms of either the Artistic License
    or the
    GNU General Public License, which may be found in the Perl 5 source kit.

    Complete documentation for Perl, including FAQ lists, should be found on
    this system using "man perl" or "perldoc perl". If you have access to the Internet, point your browser at http://www.perl.org/, the Perl Home Page.

    2025-04-02 15:52:40 root@laalaa ~
    # perl -e 'use Digest::SHA256'
    Can't locate Digest/SHA256.pm in @INC (you may need to install the Digest::SHA256 module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.32.1 /usr/local/share/perl/5.32.1 /usr/lib/x86_64-linux-gnu/perl5/5.32 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl-base /usr/lib/x86_64-linux-gnu/perl/5.32 /usr/share/perl/5.32 /usr/local/lib/site_perl) at -e line 1.
    BEGIN failed--compilation aborted at -e line 1.


    The Debian package "libdigest-sha-perl" appears to be what I need:

    2025-04-02 15:54:17 root@laalaa ~
    # apt-cache search SHA | grep 256 | grep -i perl
    libdigest-sha-perl - Perl extension for SHA-1/224/256/384/512,
    SHA-512/224 and SHA-512/256


    But installing libdigest-sha-perl does not provide Digest::SHA256:

    2025-04-02 16:02:55 root@laalaa ~
    # apt-get install libdigest-sha-perl
    Reading package lists... Done
    Building dependency tree... Done
    Reading state information... Done
    The following NEW packages will be installed:
    libdigest-sha-perl
    0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
    Need to get 0 B/57.0 kB of archives.
    After this operation, 136 kB of additional disk space will be used.
    Selecting previously unselected package libdigest-sha-perl.
    (Reading database ... 174496 files and directories currently installed.) Preparing to unpack .../libdigest-sha-perl_6.02-1+b3_amd64.deb ...
    Adding 'diversion of /usr/bin/shasum to /usr/bin/shasum.bundled by libdigest-sha-perl'
    Adding 'diversion of /usr/share/man/man1/shasum.1.gz to /usr/share/man/man1/shasum.bundled.1.gz by libdigest-sha-perl'
    Unpacking libdigest-sha-perl (6.02-1+b3) ...
    Setting up libdigest-sha-perl (6.02-1+b3) ...
    Processing triggers for man-db (2.9.4-2) ...

    2025-04-02 16:03:02 root@laalaa ~
    # perl -e 'use Digest::SHA256'
    Can't locate Digest/SHA256.pm in @INC (you may need to install the Digest::SHA256 module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.32.1 /usr/local/share/perl/5.32.1 /usr/lib/x86_64-linux-gnu/perl5/5.32 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl-base /usr/lib/x86_64-linux-gnu/perl/5.32 /usr/share/perl/5.32 /usr/local/lib/site_perl) at -e line 1.
    BEGIN failed--compilation aborted at -e line 1.


    Comments or suggestions?


    David

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Greg Wooledge@21:1/5 to David Christensen on Thu Apr 3 01:20:01 2025
    On Wed, Apr 02, 2025 at 16:07:36 -0700, David Christensen wrote:
    But installing libdigest-sha-perl does not provide Digest::SHA256:

    They are different modules.

    https://metacpan.org/pod/Digest::SHA256
    https://metacpan.org/pod/Digest::SHA

    Digest::SHA256 appears to be much, much older and probably abandoned.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Christensen@21:1/5 to Greg Wooledge on Thu Apr 3 01:40:01 2025
    On 4/2/25 16:18, Greg Wooledge wrote:
    On Wed, Apr 02, 2025 at 16:07:36 -0700, David Christensen wrote:
    But installing libdigest-sha-perl does not provide Digest::SHA256:

    They are different modules.

    https://metacpan.org/pod/Digest::SHA256
    https://metacpan.org/pod/Digest::SHA

    Digest::SHA256 appears to be much, much older and probably abandoned.


    2025-04-02 16:31:51 dpchrist@laalaa ~
    $ perl -e 'use Digest::SHA qw(sha256_hex); print sha256_hex("hello"), $/' 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824

    2025-04-02 16:32:01 dpchrist@laalaa ~
    $


    Thank you.


    David

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From debian-user@howorth.org.uk@21:1/5 to Greg Wooledge on Thu Apr 3 13:40:01 2025
    Greg Wooledge <greg@wooledge.org> wrote:
    On Wed, Apr 02, 2025 at 16:07:36 -0700, David Christensen wrote:
    But installing libdigest-sha-perl does not provide Digest::SHA256:

    They are different modules.

    https://metacpan.org/pod/Digest::SHA256
    https://metacpan.org/pod/Digest::SHA

    Digest::SHA256 appears to be much, much older and probably abandoned.

    FWIW, it seems that the author of the older package has died. :(

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael Paoli@21:1/5 to dpchrist@holgerdanske.com on Fri Apr 4 05:20:01 2025
    (response bits in-line):

    On Wed, Apr 2, 2025 at 4:08 PM David Christensen
    <dpchrist@holgerdanske.com> wrote:
    I would like to use the Perl module Digest::SHA256 on Debian:
    # cat /etc/debian_version ; uname -a
    11.11
    Linux laalaa 5.10.0-34-amd64 #1 SMP Debian 5.10.234-1 (2025-02-24)
    x86_64 GNU/Linux
    # perl -e 'use Digest::SHA256'
    Can't locate Digest/SHA256.pm in @INC (you may need to install the
    The Debian package "libdigest-sha-perl" appears to be what I need:
    # apt-cache search SHA | grep 256 | grep -i perl
    libdigest-sha-perl - Perl extension for SHA-1/224/256/384/512,
    SHA-512/224 and SHA-512/256
    Yes.
    But installing libdigest-sha-perl does not provide Digest::SHA256:
    # apt-get install libdigest-sha-perl
    The following NEW packages will be installed:
    libdigest-sha-perl
    0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
    # perl -e 'use Digest::SHA256'
    Can't locate Digest/SHA256.pm in @INC (you may need to install the
    Yes, also the case.
    Comments or suggestions?
    Debian bullseye 11 (currently oldstable) provides: https://packages.debian.org/bullseye/libdigest-sha-perl
    which provides Digest::SHA
    As far as I'm aware, Debian bullseye 11 does not provide and has not
    provided Digest::SHA256.
    See also: https://manpages.debian.org/bookworm/libdigest-sha-perl/Digest::SHA.3pm.en.html Note the syntax will be a bit different, e.g.:
    use Digest::SHA;
    or, e.g.:
    use Digest::SHA qw(sha256 ...);
    The syntax on the functions may be different too.
    Debian has provided libdigest-sha-perl back to at least 2005, see: https://snapshot.debian.org/binary/libdigest-sha-perl/
    But I'm not finding evidence Debian has ever provided Digest::SHA256.
    I'd suggest using Debian's libdigest-sha-perl
    and use Digest::SHA and make any needed perl code adjustments.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)