Digest::file(3pm)
πΈ NAME πΈ
Bestie, welcome to Digest::file(3pm) from the Perl Programmers Reference Guide β this module is literally here to Calculate digests of files. Periodt. π
β¨ SYNOPSIS β¨
Hereβs the iconic βpoor manβs md5sumβ moment, copied exactly so you can slay it yourself:
# Poor mans "md5sum" command
use Digest::file qw(digest_file_hex);
for (@ARGV) {
print digest_file_hex($_, "MD5"), " $_\n";
}
π DESCRIPTION π
This module provides 3 convenience functions to calculate the digest of files. The following functions are provided:
π digest_file( $file, $algorithm, [$arg,...] )
This function will calculate and return the binary digest of the bytes of the given file. The function will croak if it fails to open or read the file. π
The $algorithm is a string like "MD2", "MD5", "SHA-1", "SHA-512". Additional arguments are passed to the constructor for the implementation of the given algorithm. π«Ά
π¦ digest_file_hex( $file, $algorithm, [$arg,...] )
Same as digest_file(), but return the digest in hex form. β¨
π digest_file_base64( $file, $algorithm, [$arg,...] )
Same as digest_file(), but return the digest as a base64 encoded string. π
π₯ SEE ALSO π₯
Digest
okay bye bestie π
β this page is from perl v5.42.3, dated 2026-11-03, and itβs the Digest::file(3pm) manual page. mwah π«Ά
π¦ where this page comes from
- alpine 3.24: perl-doc 5.42.3-r0 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms