Digest::HMAC_MD5 – Keyed-Hashing for Message Authentication
| Use Case | Command | Description |
|---|---|---|
| 🔑 Compute HMAC-MD5 digest (binary) | hmac_md5($data, $key) | Returns binary HMAC-MD5 of $data with $key |
| 🔡 Compute HMAC-MD5 hex digest | hmac_md5_hex($data, $key) | Returns hexadecimal HMAC-MD5 |
| 🧱 OO: create HMAC object | Digest::HMAC_MD5->new($key) | Create new HMAC-MD5 object with given key |
| ➕ OO: add data | $hmac->add($data) | Add data to the digest |
| 📁 OO: add file | $hmac->addfile(*FILE) | Read file handle and add its content |
| 🔢 OO: get binary digest | $hmac->digest | Return binary HMAC-MD5 digest |
| 🔢 OO: get hex digest | $hmac->hexdigest | Return hexadecimal HMAC-MD5 digest |
| 🔢 OO: get base64 digest | $hmac->b64digest | Return base64 encoded HMAC-MD5 digest |
# Functional style
use Digest::HMAC_MD5 qw(hmac_md5 hmac_md5_hex);
$digest = hmac_md5($data, $key);
print hmac_md5_hex($data, $key);
# OO style
use Digest::HMAC_MD5;
$hmac = Digest::HMAC_MD5->new($key);
$hmac->add($data);
$hmac->addfile(*FILE);
$digest = $hmac->digest;
$digest = $hmac->hexdigest;
$digest = $hmac->b64digest;
🔐 This module provides HMAC-MD5 hashing.
Andrew Rodland <arodland AT cpan.org>
Gisle Aas <gisle AT aas.no>
Generated by phpman v4.10.0-7-g98e9fd5 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-09-06 09:08 @216.73.217.88
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)