IO::Digest(3pm)
π IO::Digest β the manual, but make it cute π
okay so bestie, welcome to IO::Digest(3pm), which lives in the User Contributed Perl Documentation corner of the perl world πΈ. she's a lil module that does one job and does it flawlessly, and i'm about to tell you everything about her, no skips, no cuts, periodt. β¨
π NAME π
IO::Digest β Calculate digests while reading or writing. that's the whole vibe. π
β¨ SYNOPSIS β¨
like ok here's the whole thing, look at her:
use IO::Digest;
# Get a Digest::MD5 object that takes input while $fh being written or read
my $fh;
my $iod = IO::Digest->new ($fh, 'MD5');
print $fh "fooo";
print $iod->hexdigest
so you make a $fh, you hand it to IO::Digest->new with 'MD5', and then every single thing you print into $fh is also getting digested in real time. then you just call $iod->hexdigest and boom π₯ the hash is right there waiting for you. it's giving multitasking. it's giving efficiency. iconic. π
π¦ DESCRIPTION π¦
okay so here's the tea π: this module lets you calculate digests while you're reading or writing file handles. that's the whole point.
and why do we care?? because it avoids the case where you'd have to reread the exact same content all over again just to compute the digests after you've already written a file. like, imagine doing all that work twice. not her. she would never. π she computes as she goes, main character energy only. π
π§ TEST COVERAGE π§
look at this. LOOK AT IT. 100.0 across the board, no cap. π―π₯
----------------------------------- ------ ------ ------ ------ ------ ------
File stmt branch cond sub time total
----------------------------------- ------ ------ ------ ------ ------ ------
blib/lib/IO/Digest.pm 100.0 n/a n/a 100.0 100.0 100.0
Total 100.0 n/a n/a 100.0 100.0 100.0
----------------------------------- ------ ------ ------ ------ ------ ------
she ate and left no crumbs. π
π AUTHORS π
Chia-liang Kao <clkao@clkao.org> β the legend themselves, we stan π«Ά
πΈ COPYRIGHT πΈ
Copyright 2004 by Chia-liang Kao <clkao@clkao.org>.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See <http://www.perl.com/perl/misc/Artistic.html> β¨
real talk bestie, if you're out here redistributing or modifying her, keep that copyright line and the Artistic-license URL intact, fr fr. don't be that person. π
and that's the whole page!! mwah π this was perl v5.38.2, dated 2024-08-10, and yes it's still IO::Digest(3pm) π bye bestie, go hash something π₯π
π¦ where this page comes from
- debian trixie: libio-digest-perl 0.11-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libio-digest-perl 0.11-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libio-digest-perl 0.11-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms