ADC Home > Reference Library > Reference > Mac OS X > Mac OS X Man Pages

 

This document is a Mac OS X manual page. Manual pages are a command-line technology for providing documentation. You can view these manual pages locally using the man(1) command. These manual pages come from many different sources, and thus, have a variety of writing styles.

For more information about the manual page format, see the manual page for manpages(5).



Digest::file(3pm)                     Perl Programmers Reference Guide                     Digest::file(3pm)



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 func-tions functions
       tions 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 v5.8.8                                      2001-09-21                                Digest::file(3pm)

Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.