#!/usr/bin/perl -w #< haval: compute Haval signature for files or stdin use strict; use Digest::Haval256; my $haval = new Digest::Haval256 or die; my $fh; @ARGV = ("-") unless @ARGV; # handle stdin. for my $file (@ARGV) { if (open($fh, "< $file")) { $haval->addfile($fh); close($fh); print $haval->hexdigest(), " $file\n"; $haval->reset(); } else { warn "$file: $!\n"; } } exit(0);