On Thu, 2007-02-01 at 02:44 -0500, M. Lewis wrote:
> I'm trying to write an interface to check SHA1 or SHA256 checksums of a
> file.
> 
> Initially I was thinking of opening the checksum file and figuring out
> based on the contents of that file, is it a SHA1 checksum or a SHA256
> checksum.
> 
> I realize it would be 'easier' to pass as an argument to the script
> which type of checksum we're trying to check.
> 
> My question is, which is the better way?
> 
> - Let the script figure it out or pass it as an argument on the command
> line?
> - And why is it better?

If at all possible try and let the script figure it out.  Someone will
pass the wrong value and it will fail and it will always fail in the
middle of the night.

however

If you are provided controlled documents that must be checked against a
certain key for a certain client then you could be adding extra security
versus extra complexity.


-- 
Ken Foskey
FOSS developer


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to