IO::Digest(3pm)

πŸ“¦
version 0.11 Β· 6 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

πŸ’– 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 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