go ahead... be a heretic | |
PerlMonks |
How to force Digest::SHA1/MD5 to reset?by lestrrat (Deacon) |
on Oct 21, 2003 at 21:20 UTC ( [id://301077]=perlquestion: print w/replies, xml ) | Need Help?? |
lestrrat has asked for the wisdom of the Perl Monks concerning the following question: I thought I knew how to use Digest::(MD5|SHA1), but apparently not. I've found out that when I have a function like this:
I get different results for the first time I call the function and the subsequent calls in the same process. The sequence is always the same, though... and it looks something like this:
But the two digests that I get are always the same, it's just that successive calls within the same process seem to stack the previous data passed by add() or addfile() This leads me to believe that some how Digest::SHA1 is not resetting its state when new() is called.... I tried calling reset(), but that didn't work either. Am I missing something? Is there a workaround?
Back to
Seekers of Perl Wisdom
|
|