1Digest::file(3) User Contributed Perl Documentation Digest::file(3)
2
3
4
6 Digest::file - Calculate digests of files
7
9 # Poor mans "md5sum" command
10 use Digest::file qw(digest_file_hex);
11 for (@ARGV) {
12 print digest_file_hex($_, "MD5"), " $_\n";
13 }
14
16 This module provide 3 convenience functions to calculate the digest of
17 files. The following functions are provided:
18
19 digest_file( $file, $algorithm, [$arg,...] )
20 This function will calculate and return the binary digest of the
21 bytes of the given file. The function will croak if it fails to
22 open or read the file.
23
24 The $algorithm is a string like "MD2", "MD5", "SHA-1", "SHA-512".
25 Additional arguments are passed to the constructor for the
26 implementation of the given algorithm.
27
28 digest_file_hex( $file, $algorithm, [$arg,...] )
29 Same as digest_file(), but return the digest in hex form.
30
31 digest_file_base64( $file, $algorithm, [$arg,...] )
32 Same as digest_file(), but return the digest as a base64 encoded
33 string.
34
36 Digest
37
38
39
40perl v5.36.0 2022-07-22 Digest::file(3)