MD4: Difference between revisions
m
→{{header|Perl}}: future-proof for 5.36, explicit :prototype
Thundergnat (talk | contribs) m (syntax highlighting fixup automation) |
SqrtNegInf (talk | contribs) m (→{{header|Perl}}: future-proof for 5.36, explicit :prototype) |
||
Line 1,267:
=={{header|Perl}}==
In-lining code from module [https://metacpan.org/pod/Digest::Perl::MD4 Digest::Perl::MD4], lightly edited for clarity.
<syntaxhighlight lang="perl">sub md4 :prototype(@) {
my @input = grep { defined && length > 0 } split /(.{64})/s, join '', @_;
push @input, '' if !@input || length($input[$#input]) >= 56;
Line 1,328:
}
sub md4_hex :prototype(@) { # convert to hexadecimal
unpack 'H*', &md4;
}
|