Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Digest::MD5 and SHA addfile appear to be clearing the buffer

by atcroft (Abbot)
on Jun 10, 2014 at 18:16 UTC ( [id://1089443]=note: print w/replies, xml ) Need Help??


in reply to Digest::MD5 and SHA addfile appear to be clearing the buffer

Instead of using the filehandle, you could just pass the filename to the addfile() method (such as print "SHA224: ", $sha224->addfile($file, "b")->hexdigest, "\n";), which would let the module handle the details.

Hope that helps.

Replies are listed 'Best First'.
Re^2: Digest::MD5 and SHA addfile appear to be clearing the buffer
by dt667 (Acolyte) on Jun 11, 2014 at 11:05 UTC

    I just assumed the MD5 and SHA modules took the same parameters, but it appears the MD5 module requires a filehandle where as the SHA module takes either a filehandle or filename. Thanks!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1089443]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2024-04-25 11:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found