asuswrt-merlin.ng/release/src-rt-5.02axhnd/hostTools/perlmd5/perlmd5.pl
2020-08-28 22:07:59 -04:00

18 lines
310 B
Perl

#!/usr/bin/env perl -w
use Digest::MD5;
$num_args = $#ARGV + 1;
if ($num_args != 1) {
print "\nUsage: perlmd5 filename\n";
exit;
}
$filename=$ARGV[0];
open(my $fh, "<", $filename)
or die "cannot open $filename $!";
$ctx = Digest::MD5->new;
$ctx->addfile($fh);
print lc $ctx->hexdigest . "\n";