SHA question

Steffan Davies steff at
Wed Jan 13 13:17:29 GMT 2010

Dermot <paikkos at> wrote at 12:44 on 2010-01-13:

> Hi,
> I have a lots of PDFs that I need to catalogue and I want to ensure
> the uniqueness of each PDF.  At LWP, Jonathan Rockway mentioned
> something similar with SHA1 and binary files.  Am I right in thinking
> that the code below is only taking the SHA on the name of the file and
> if I want to ensure uniqueness of the content I need to do something
> similar but as a file blob?

Yes, that looks about right. From a brief look at it appears that you may want 

my $sha = Digest::SHA->new(512);
$digest=$sha->digest; # or hexdigest or b64digest

in your inner loop.


More information about the mailing list