actually batch is called like this:
c:\>md5.bat HEX file.txt
Where %1 points to a label and %2 feeds the perl one-liner the file name. Here is the batch code:
@echo off
goto %1
goto END
:BASE64
echo Digesting %2
d:\perl\bin\perl.exe -MDigest::MD5 -e "open(FH,shift);print Digest::MD
+5->new->addfile(FH)->b64digest" %2
goto END
:BIN
d:\perl\bin\perl.exe -MDigest::MD5 -e "open(FH,shift);print Digest::MD
+5->new->addfile(FH)->digest" %2
goto END
:HEX
d:\perl\bin\perl.exe -MDigest::MD5 -e "open(FH,shift);print Digest::MD
+5->new->addfile(FH)->hexdigest" %2
goto END
:END
echo.
echo Bye
And the one-liner is executed:
d:\perl\bin\perl.exe -MDigest::MD5 -e "open(FH,shift);print Digest::MD5->new->addfile(FH)->hexdigest" file.txt
No space in the file name. It works every time, it's just that the hash is
different for each method.
Note:they are consistent in their disagreement.
Here is the HEX output for the .bat method:
b2dac3151aa297fe172ee847b9317c31
Here is the output from the perl one liner run at the command line:
7b3c4b4d258a62aa54821ad9e4cbfc05
Thanks for the help!
humbly,
novitiate
"...goodnight you princes of main(e)"  --The Cider House Rules
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.