summaryrefslogtreecommitdiff
path: root/perl/testmd.pl
blob: a17ac6b90cf37bfa8c2f2f2e2970c64de04fa731 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/local/bin/perl

use ExtUtils::testlib;

use SSLeay;

@md=();
foreach ("md2", "md5", "sha", "sha1", "mdc2", "ripemd160")
	{
	($f=MD->new($_)) ||
		die "$_ is an unknown message digest algorithm\n";
	push(@md,$f);
	}

while (<>)
	{
	foreach $md (@md)
		{ $md->update($_); }
	}

foreach (@md)
	{
	$digest=$_->final();
	printf "%-4s=%s\n",$_->name(),unpack("H*",$digest);
	}