NAME
gmd5 - Pure Perl implementation of MD5 hashing
SYNOPSIS
use gmd5 qw(md5 md5_hex);
# Direct hash
my $binary = md5("Hello World");
my $hex = md5_hex("Hello World");
# Streaming hash
my $md5 = gmd5->new;
$md5->add("Hello ");
$md5->add("World");
$hex = $md5->hexdigest;
DESCRIPTION
gmd5
provides a fast and lightweight MD5 hashing library in Pure Perl, with no XS or C dependencies. It supports both one-shot hashing and streaming for large datasets, optimized with efficient buffering and bitwise operations. The implementation is compliant with RFC 1321.
METHODS
- new()
-
Creates a new gmd5 object.
my $md5 = gmd5->new;
- add($data)
-
Adds data to the MD5 computation.
$md5->add("Hello World");
- digest()
-
Returns the binary MD5 digest.
my $binary = $md5->digest;
- hexdigest()
-
Returns the hexadecimal MD5 digest.
my $hex = $md5->hexdigest;
- reset()
-
Resets the MD5 object to its initial state.
$md5->reset;
EXPORTABLE FUNCTIONS
- md5($data)
-
Computes the binary MD5 digest of $data.
my $binary = md5("Hello World");
- md5_hex($data)
-
Computes the hexadecimal MD5 digest of $data.
my $hex = md5_hex("Hello World");
AUTHOR
OnEhIppY, Domero Software <domerosoftware@gmail.com>
LICENSE
This module is released under the Perl 5 license.
SEE ALSO
RFC 1321 - The MD5 Message-Digest Algorithm