{
    "content": [
        {
            "type": "text",
            "text": "# Digest::MD5::File (perldoc)\n\n## NAME\n\nDigest::MD5::File - Perl extension for getting MD5 sums for files and urls.\n\n## SYNOPSIS\n\nuse Digest::MD5::File qw(dirmd5hex filemd5hex urlmd5hex);\nmy $md5 = Digest::MD5->new;\n$md5->addpath('/path/to/file');\nmy $digest = $md5->hexdigest;\nmy $digest = filemd5($file);\nmy $digest = filemd5hex($file);\nmy $digest = filemd5base64($file);\nmy $md5 = Digest::MD5->new;\n$md5->addurl('http://www.tmbg.com/tour.html');\nmy $digest = $md5->hexdigest;\nmy $digest = urlmd5($url);\nmy $digest = urlmd5hex($url);\nmy $digest = urlmd5base64($url);\nmy $md5 = Digest::MD5->new;\n$md5->adddir('/directory');\nmy $digest = $md5->hexdigest;\nmy $dirhashref = dirmd5($dir);\nmy $dirhashref = dirmd5hex($dir);\nmy $dirhashref = dirmd5base64($dir);\n\n## DESCRIPTION\n\nGet MD5 sums for files of a given path or content of a given url.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **EXPORT**\n- **OBJECT METHODS** (1 subsections)\n- **SPECIAL SETTINGS**\n- **SEE ALSO**\n- **AUTHOR**\n- **COPYRIGHT AND LICENSE**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Digest::MD5::File",
        "section": "",
        "mode": "perldoc",
        "summary": "Digest::MD5::File - Perl extension for getting MD5 sums for files and urls.",
        "synopsis": "use Digest::MD5::File qw(dirmd5hex filemd5hex urlmd5hex);\nmy $md5 = Digest::MD5->new;\n$md5->addpath('/path/to/file');\nmy $digest = $md5->hexdigest;\nmy $digest = filemd5($file);\nmy $digest = filemd5hex($file);\nmy $digest = filemd5base64($file);\nmy $md5 = Digest::MD5->new;\n$md5->addurl('http://www.tmbg.com/tour.html');\nmy $digest = $md5->hexdigest;\nmy $digest = urlmd5($url);\nmy $digest = urlmd5hex($url);\nmy $digest = urlmd5base64($url);\nmy $md5 = Digest::MD5->new;\n$md5->adddir('/directory');\nmy $digest = $md5->hexdigest;\nmy $dirhashref = dirmd5($dir);\nmy $dirhashref = dirmd5hex($dir);\nmy $dirhashref = dirmd5base64($dir);",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 26,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "EXPORT",
                "lines": 7,
                "subsections": []
            },
            {
                "name": "OBJECT METHODS",
                "lines": 10,
                "subsections": [
                    {
                        "name": "addpath",
                        "lines": 35
                    }
                ]
            },
            {
                "name": "SPECIAL SETTINGS",
                "lines": 54,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "COPYRIGHT AND LICENSE",
                "lines": 5,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Digest::MD5::File - Perl extension for getting MD5 sums for files and urls.\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use Digest::MD5::File qw(dirmd5hex filemd5hex urlmd5hex);\n\nmy $md5 = Digest::MD5->new;\n$md5->addpath('/path/to/file');\nmy $digest = $md5->hexdigest;\n\nmy $digest = filemd5($file);\nmy $digest = filemd5hex($file);\nmy $digest = filemd5base64($file);\n\nmy $md5 = Digest::MD5->new;\n$md5->addurl('http://www.tmbg.com/tour.html');\nmy $digest = $md5->hexdigest;\n\nmy $digest = urlmd5($url);\nmy $digest = urlmd5hex($url);\nmy $digest = urlmd5base64($url);\n\nmy $md5 = Digest::MD5->new;\n$md5->adddir('/directory');\nmy $digest = $md5->hexdigest;\n\nmy $dirhashref = dirmd5($dir);\nmy $dirhashref = dirmd5hex($dir);\nmy $dirhashref = dirmd5base64($dir);\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "Get MD5 sums for files of a given path or content of a given url.\n",
                "subsections": []
            },
            "EXPORT": {
                "content": "None by default. You can export any file* dir*, or url* function and anything Digest::MD5 can\nexport.\n\nuse Digest::MD5::File qw(md5 md5hex md5base64); # 3 Digest::MD5 functions\nprint md5hex('abc123'), \"\\n\";\nprint md5base64('abc123'), \"\\n\";\n",
                "subsections": []
            },
            "OBJECT METHODS": {
                "content": "addpath()\nmy $md5 = Digest::MD5->new;\n$md5->addpath('/path/to/file.txt')\nor die \"file.txt is not where you said: $!\";\n\nor you can add multiple files by specifying an array ref of files:\n\n$md5->addpath(\\@files);\n\nadddir()",
                "subsections": [
                    {
                        "name": "addpath",
                        "content": "my $md5 = Digest::MD5->new;\n$md5->adddir('/home/tmbg/')\nor die \"See warning above to see why I bailed: $!\";\n\naddurl()\nmy $md5 = Digest::MD5->new;\n$md5->addurl('http://www.tmbg.com/tour.html')\nor die \"They Must Be not on tour\";\n\nfile* functions\nGet the digest in variouse formats of $file. If file does not exist or is a directory it croaks\n(See NOFATALS for more info)\n\nmy $digest = filemd5($file) or warn \"$file failed: $!\";\nmy $digest = filemd5hex($file) or warn \"$file failed: $!\";\nmy $digest = filemd5base64($file) or warn \"$file failed: $!\";\n\ndir* functions\nReturns a hashref whose keys are files relative to the given path and the values are the MD5 sum\nof the file or and empty string if a directory. It recurses through the entire depth of the\ndirectory. Symlinks to files are just addpath()d and symlinks to directories are followed.\n\nmy $dirhashref = dirmd5($dir) or warn \"$dir failed: $!\";\nmy $dirhashref = dirmd5hex($dir) or warn \"$dir failed: $!\";\nmy $dirhashref = dirmd5base64($dir) or warn \"$dir failed: $!\";\n\nurl* functions\nGet the digest in various formats of the content at $url (Including, if $url points to\ndirectory, the directory listing content). Returns undef if url fails (IE if LWP::UserAgent's\n$res->issuccess is false)\n\nmy $digest = urlmd5($url) or warn \"$url failed\";\nmy $digest = urlmd5hex($url) or warn \"$url failed\";\nmy $digest = urlmd5base64($url) or warn \"$url failed\";\n"
                    }
                ]
            },
            "SPECIAL SETTINGS": {
                "content": "BINMODE\nBy default files are opened in binmode. If you do not want to do this you can unset it a variety\nof ways:\n\nuse Digest::MD5::File qw(-nobin);\n\nor\n\n$Digest::MD5::File::BINMODE = 0;\n\nor at the function/method level by specifying its value as the second argument:\n\n$md5->addpath($file,0);\n\nmy $digest = filemd5hex($file,0);\n\nUTF8\nIn some cases you may want to have your data utf8 encoded, you can do this the following ways:\n\nuse Digest::MD5::File qw(-utf8);\n\nor\n\n$Digest::MD5::File::UTF8 = 1;\n\nor at the function/method level by specifying its value as the third argument for files and\nsecond for urls:\n\n$md5->addpath($file,$binmode,1);\n\nmy $digest = filemd5hex($file,$binmode,1);\n\n$md5->addurl($url,1);\n\nurlmd5hex($url,1);\n\nIt use's Encode's encodeutf8() function to do the encoding. So if you do not have Encode (pre\n5.7.3) this won't work :)\n\nNOFATALS\nInstead of croaking it will return undef if you set NOFATALS to true.\n\nYou can do this two ways:\n\n$Digest::MD5::File::NOFATALS = 1;\n\nor the -nofatals flag:\n\nuse Digest::MD5::File qw(-nofatals);\n\nmy $digest = filemd5hex($file) or die \"$file failed\";\n\n$! is not set so its not really helpful if you die().\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "Digest::MD5, Encode, LWP::UserAgent\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Daniel Muey, <http://drmuey.com/cpancontact.pl>\n",
                "subsections": []
            },
            "COPYRIGHT AND LICENSE": {
                "content": "Copyright 2005 by Daniel Muey\n\nThis library is free software; you can redistribute it and/or modify it under the same terms as\nPerl itself.\n",
                "subsections": []
            }
        }
    }
}