{
    "content": [
        {
            "type": "text",
            "text": "# Digest::HMAC (perldoc)\n\n## NAME\n\nDigest::HMAC - Keyed-Hashing for Message Authentication\n\n## SYNOPSIS\n\n# Functional style\nuse Digest::HMAC qw(hmac hmachex);\n$digest = hmac($data, $key, \\&myhash);\nprint hmachex($data, $key, \\&myhash);\n# OO style\nuse Digest::HMAC;\n$hmac = Digest::HMAC->new($key, \"Digest::MyHash\");\n$hmac->add($data);\n$hmac->addfile(*FILE);\n$digest = $hmac->digest;\n$digest = $hmac->hexdigest;\n$digest = $hmac->b64digest;\n\n## DESCRIPTION\n\nHMAC is used for message integrity checks between two parties that share a secret key, and works\nin combination with some other Digest algorithm, usually MD5 or SHA-1. The HMAC mechanism is\ndescribed in RFC 2104.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **SEE ALSO**\n- **MAINTAINER**\n- **ORIGINAL AUTHORS**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Digest::HMAC",
        "section": "",
        "mode": "perldoc",
        "summary": "Digest::HMAC - Keyed-Hashing for Message Authentication",
        "synopsis": "# Functional style\nuse Digest::HMAC qw(hmac hmachex);\n$digest = hmac($data, $key, \\&myhash);\nprint hmachex($data, $key, \\&myhash);\n# OO style\nuse Digest::HMAC;\n$hmac = Digest::HMAC->new($key, \"Digest::MyHash\");\n$hmac->add($data);\n$hmac->addfile(*FILE);\n$digest = $hmac->digest;\n$digest = $hmac->hexdigest;\n$digest = $hmac->b64digest;",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 16,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 15,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "MAINTAINER",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "ORIGINAL AUTHORS",
                "lines": 2,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Digest::HMAC - Keyed-Hashing for Message Authentication\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "# Functional style\nuse Digest::HMAC qw(hmac hmachex);\n$digest = hmac($data, $key, \\&myhash);\nprint hmachex($data, $key, \\&myhash);\n\n# OO style\nuse Digest::HMAC;\n$hmac = Digest::HMAC->new($key, \"Digest::MyHash\");\n\n$hmac->add($data);\n$hmac->addfile(*FILE);\n\n$digest = $hmac->digest;\n$digest = $hmac->hexdigest;\n$digest = $hmac->b64digest;\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "HMAC is used for message integrity checks between two parties that share a secret key, and works\nin combination with some other Digest algorithm, usually MD5 or SHA-1. The HMAC mechanism is\ndescribed in RFC 2104.\n\nHMAC follow the common \"Digest::\" interface, but the constructor takes the secret key and the\nname of some other simple \"Digest::\" as argument.\n\nThe hmac() and hmachex() functions and the Digest::HMAC->new() constructor takes an optional\n$blocksize argument as well. The HMAC algorithm assumes the digester to hash by iterating a\nbasic compression function on blocks of data and the $blocksize should match the byte-length of\nsuch blocks.\n\nThe default $blocksize is 64 which is suitable for the MD5 and SHA-1 digest functions. For\nstronger algorithms the blocksize probably needs to be increased.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "Digest::HMACMD5, Digest::HMACSHA1\n\nRFC 2104\n",
                "subsections": []
            },
            "MAINTAINER": {
                "content": "Andrew Rodland <arodland@cpan.org>\n",
                "subsections": []
            },
            "ORIGINAL AUTHORS": {
                "content": "Graham Barr <gbarr@ti.com>, Gisle Aas <gisle@aas.no>\n",
                "subsections": []
            }
        }
    }
}