{
    "mode": "perldoc",
    "parameter": "Digest::file",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Digest%3A%3Afile/json",
    "generated": "2026-06-10T07:42:47Z",
    "synopsis": "# Poor mans \"md5sum\" command\nuse Digest::file qw(digestfilehex);\nfor (@ARGV) {\nprint digestfilehex($, \"MD5\"), \"  $\\n\";\n}",
    "sections": {
        "NAME": {
            "content": "Digest::file - Calculate digests of files\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "# Poor mans \"md5sum\" command\nuse Digest::file qw(digestfilehex);\nfor (@ARGV) {\nprint digestfilehex($, \"MD5\"), \"  $\\n\";\n}\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This module provide 3 convenience functions to calculate the digest of files. The following\nfunctions are provided:\n",
            "subsections": [
                {
                    "name": "digest_file",
                    "content": "This function will calculate and return the binary digest of the bytes of the given file.\nThe function will croak if it fails to open or read the file.\n\nThe $algorithm is a string like \"MD2\", \"MD5\", \"SHA-1\", \"SHA-512\". Additional arguments are\npassed to the constructor for the implementation of the given algorithm.\n"
                },
                {
                    "name": "digest_file_hex",
                    "content": "Same as digestfile(), but return the digest in hex form.\n"
                },
                {
                    "name": "digest_file_base64",
                    "content": "Same as digestfile(), but return the digest as a base64 encoded string.\n"
                }
            ]
        },
        "SEE ALSO": {
            "content": "Digest\n",
            "subsections": []
        }
    },
    "summary": "Digest::file - Calculate digests of files",
    "flags": [],
    "examples": [],
    "see_also": []
}