This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[PATCH] long C<=item>s in pod/perlunicode.pod
[perl5.git] / lib / Digest.t
CommitLineData
3357b1b1
JH
1print "1..3\n";
2
3357b1b1
JH
3use Digest;
4
67859229
JH
5my $hexdigest = "900150983cd24fb0d6963f7d28e17f72"; # ASCII
6
d2f5bb60
PP
7if (ord('A') == 193) { # EBCDIC
8 $hexdigest = "fe4ea0d98f9cd8d1d27f102a93cb0bb0"; # IBM-1047
9}
10
11print "not " unless Digest->MD5->add("abc")->hexdigest eq $hexdigest;
3357b1b1
JH
12print "ok 1\n";
13
d2f5bb60 14print "not " unless Digest->MD5->add("abc")->hexdigest eq $hexdigest;
3357b1b1
JH
15print "ok 2\n";
16
17eval {
67859229 18 # Not yet EBCDICified.
3357b1b1
JH
19 print "not " unless Digest->new("HMAC-MD5" => "Jefe")->add("what do ya want for nothing?")->hexdigest eq "750c783e6ab0b503eaa86e310a5db738";
20 print "ok 3\n";
21};
22print "ok 3\n" if $@ && $@ =~ /^Can't locate/;
23