Server IP : 103.119.228.120 / Your IP : 3.133.108.224 Web Server : Apache System : Linux v8.techscape8.com 3.10.0-1160.119.1.el7.tuxcare.els2.x86_64 #1 SMP Mon Jul 15 12:09:18 UTC 2024 x86_64 User : nobody ( 99) PHP Version : 5.6.40 Disable Function : shell_exec,symlink,system,exec,proc_get_status,proc_nice,proc_terminate,define_syslog_variables,syslog,openlog,closelog,escapeshellcmd,passthru,ocinum cols,ini_alter,leak,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dl,dll,myshellexec,proc_open,socket_bind,proc_close,escapeshellarg,parse_ini_filepopen,fpassthru,exec,passthru,escapeshellarg,escapeshellcmd,proc_close,proc_open,ini_alter,popen,show_source,proc_nice,proc_terminate,proc_get_status,proc_close,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,dl,symlink,shell_exec,system,dl,passthru,escapeshellarg,escapeshellcmd,myshellexec,c99_buff_prepare,c99_sess_put,fpassthru,getdisfunc,fx29exec,fx29exec2,is_windows,disp_freespace,fx29sh_getupdate,fx29_buff_prepare,fx29_sess_put,fx29shexit,fx29fsearch,fx29ftpbrutecheck,fx29sh_tools,fx29sh_about,milw0rm,imagez,sh_name,myshellexec,checkproxyhost,dosyayicek,c99_buff_prepare,c99_sess_put,c99getsource,c99sh_getupdate,c99fsearch,c99shexit,view_perms,posix_getpwuid,posix_getgrgid,posix_kill,parse_perms,parsesort,view_perms_color,set_encoder_input,ls_setcheckboxall,ls_reverse_all,rsg_read,rsg_glob,selfURL,dispsecinfo,unix2DosTime,addFile,system,get_users,view_size,DirFiles,DirFilesWide,DirPrintHTMLHeaders,GetFilesTotal,GetTitles,GetTimeTotal,GetMatchesCount,GetFileMatchesCount,GetResultFiles,fs_copy_dir,fs_copy_obj,fs_move_dir,fs_move_obj,fs_rmdir,SearchText,getmicrotime MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/local/share/man/man3/ |
Upload File : |
.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.28) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "File 3" .TH File 3 "2012-04-05" "perl v5.16.3" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Digest::MD5::File \- Perl extension for getting MD5 sums for files and urls. .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Digest::MD5::File qw(dir_md5_hex file_md5_hex url_md5_hex); \& \& my $md5 = Digest::MD5\->new; \& $md5\->addpath(\*(Aq/path/to/file\*(Aq); \& my $digest = $md5\->hexdigest; \& \& my $digest = file_md5($file); \& my $digest = file_md5_hex($file); \& my $digest = file_md5_base64($file); \& \& my $md5 = Digest::MD5\->new; \& $md5\->addurl(\*(Aqhttp://www.tmbg.com/tour.html\*(Aq); \& my $digest = $md5\->hexdigest; \& \& my $digest = url_md5($url); \& my $digest = url_md5_hex($url); \& my $digest = url_md5_base64($url); \& \& my $md5 = Digest::MD5\->new; \& $md5\->adddir(\*(Aq/directory\*(Aq); \& my $digest = $md5\->hexdigest; \& \& my $dir_hashref = dir_md5($dir); \& my $dir_hashref = dir_md5_hex($dir); \& my $dir_hashref = dir_md5_base64($dir); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" .Vb 1 \& Get MD5 sums for files of a given path or content of a given url. .Ve .SH "EXPORT" .IX Header "EXPORT" None by default. You can export any file_* dir_*, or url_* function and anything Digest::MD5 can export. .PP .Vb 3 \& use Digest::MD5::File qw(md5 md5_hex md5_base64); # 3 Digest::MD5 functions \& print md5_hex(\*(Aqabc123\*(Aq), "\en"; \& print md5_base64(\*(Aqabc123\*(Aq), "\en"; .Ve .SH "OBJECT METHODS" .IX Header "OBJECT METHODS" .SS "\fIaddpath()\fP" .IX Subsection "addpath()" .Vb 3 \& my $md5 = Digest::MD5\->new; \& $md5\->addpath(\*(Aq/path/to/file.txt\*(Aq) \& or die "file.txt is not where you said: $!"; .Ve .PP or you can add multiple files by specifying an array ref of files: .PP .Vb 1 \& $md5\->addpath(\e@files); .Ve .SS "\fIadddir()\fP" .IX Subsection "adddir()" \&\fIaddpath()\fRs each file in a directory recursively. Follows the same rules as the dir_* functions. .PP .Vb 3 \& my $md5 = Digest::MD5\->new; \& $md5\->adddir(\*(Aq/home/tmbg/\*(Aq) \& or die "See warning above to see why I bailed: $!"; .Ve .SS "\fIaddurl()\fP" .IX Subsection "addurl()" .Vb 3 \& my $md5 = Digest::MD5\->new; \& $md5\->addurl(\*(Aqhttp://www.tmbg.com/tour.html\*(Aq) \& or die "They Must Be not on tour"; .Ve .SH "file_* functions" .IX Header "file_* functions" Get the digest in variouse formats of \f(CW$file\fR. If file does not exist or is a directory it croaks (See \s-1NOFATALS\s0 for more info) .PP .Vb 3 \& my $digest = file_md5($file) or warn "$file failed: $!"; \& my $digest = file_md5_hex($file) or warn "$file failed: $!"; \& my $digest = file_md5_base64($file) or warn "$file failed: $!"; .Ve .SH "dir_* functions" .IX Header "dir_* functions" Returns a hashref whose keys are files relative to the given path and the values are the \s-1MD5\s0 sum of the file or and empty string if a directory. It recurses through the entire depth of the directory. Symlinks to files are just \fIaddpath()\fRd and symlinks to directories are followed. .PP .Vb 3 \& my $dir_hashref = dir_md5($dir) or warn "$dir failed: $!"; \& my $dir_hashref = dir_md5_hex($dir) or warn "$dir failed: $!"; \& my $dir_hashref = dir_md5_base64($dir) or warn "$dir failed: $!"; .Ve .SH "url_* functions" .IX Header "url_* functions" Get the digest in various formats of the content at \f(CW$url\fR (Including, if \f(CW$url\fR points to directory, the directory listing content). Returns undef if url fails (\s-1IE\s0 if LWP::UserAgent's \f(CW$res\fR\->is_success is false) .PP .Vb 3 \& my $digest = url_md5($url) or warn "$url failed"; \& my $digest = url_md5_hex($url) or warn "$url failed"; \& my $digest = url_md5_base64($url) or warn "$url failed"; .Ve .SH "SPECIAL SETTINGS" .IX Header "SPECIAL SETTINGS" .SS "\s-1BINMODE\s0" .IX Subsection "BINMODE" By default files are opened in binmode. If you do not want to do this you can unset it a variety of ways: .PP .Vb 1 \& use Digest::MD5::File qw(\-nobin); .Ve .PP or .PP .Vb 1 \& $Digest::MD5::File::BINMODE = 0; .Ve .PP or at the function/method level by specifying its value as the second argument: .PP .Vb 1 \& $md5\->addpath($file,0); \& \& my $digest = file_md5_hex($file,0); .Ve .SS "\s-1UTF8\s0" .IX Subsection "UTF8" In some cases you may want to have your data utf8 encoded, you can do this the following ways: .PP .Vb 1 \& use Digest::MD5::File qw(\-utf8); .Ve .PP or .PP .Vb 1 \& $Digest::MD5::File::UTF8 = 1; .Ve .PP or at the function/method level by specifying its value as the third argument for files and second for urls: .PP .Vb 1 \& $md5\->addpath($file,$binmode,1); \& \& my $digest = file_md5_hex($file,$binmode,1); \& \& $md5\->addurl($url,1); \& \& url_md5_hex($url,1); .Ve .PP It use's Encode's \fIencode_utf8()\fR function to do the encoding. So if you do not have Encode (pre 5.7.3) this won't work :) .SS "\s-1NOFATALS\s0" .IX Subsection "NOFATALS" Instead of croaking it will return undef if you set \s-1NOFATALS\s0 to true. .PP You can do this two ways: .PP .Vb 1 \& $Digest::MD5::File::NOFATALS = 1; .Ve .PP or the \-nofatals flag: .PP .Vb 1 \& use Digest::MD5::File qw(\-nofatals); \& \& my $digest = file_md5_hex($file) or die "$file failed"; .Ve .PP $! is not set so its not really helpful if you \fIdie()\fR. .SH "SEE ALSO" .IX Header "SEE ALSO" Digest::MD5, Encode, LWP::UserAgent .SH "AUTHOR" .IX Header "AUTHOR" Daniel Muey, <http://drmuey.com/cpan_contact.pl> .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" Copyright 2005 by Daniel Muey .PP This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.