Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Checksum for Windows

by tachyon (Chancellor)
on Jul 21, 2003 at 13:08 UTC ( #276255=note: print w/ replies, xml ) Need Help??


in reply to Checksum for Windows

System independent.....

#!/usr/bin/perl use Digest::MD5 'md5_hex'; undef $/; open F, $ARGV[0] or die "Usage $0 <file>\n$!\n"; binmode F; print md5_hex(<F>); close F;

Update

Added binmode for Win32, Mac as suggested by particle

cheers

tachyon

s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print


Comment on Re: Checksum for Windows
Download Code
Re^2: Checksum for Windows
by particle (Vicar) on Jul 21, 2003 at 18:00 UTC

    although i haven't tested, this looks suspiciously like a case where binmode might be necessary.

    as it stands, it can also be written as a one-liner, like

    perl -000 -MDigest::MD5=md5_hex -ne"$\=md5_hex}{print" your_file_here

    note the triple-zero option to undefine the output line seperator.

    ~Particle *accelerates*

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (11)
As of 2014-07-22 22:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (129 votes), past polls