Perl Diver 2.31
Main Environment Variables Perl Default Values Perl Config - Summary Perl Config - Full Installed Modules List Directory uptime Docs

Module Documentation
Details and documentation about a specific module, including version and documentation (if available). Note that while links to perldoc.com and search.cpan.org are provided, the module may be part of a larger distribution. If you reach a File Not Found page on either site, please try the parent module.

Digest::file

Name Digest::file
Version 1.16
Located at /usr/share/perl5/vendor_perl
File /usr/share/perl5/vendor_perl/Digest/file.pm
Is Core No
Search CPAN for this module Digest::file
Documentation Digest::file
Module Details Digest::file

NAME

Digest::file - Calculate digests of files


SYNOPSIS

  # Poor mans "md5sum" command
  use Digest::file qw(digest_file_hex);
  for (@ARGV) {
      print digest_file_hex($_, "MD5"), "  $_\n";
  }


DESCRIPTION

This module provide 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

Perl Diver brought to you by ScriptSolutions.com © 1997- 2024