Thursday, March 15, 2007

Sometimes you just need some Hash(es)

James Manning's blog - get-hashes.ps1: Get the hashes (sha256, md5, whatever) for a file

"A slight modification of Mike's version, since sometimes I want md5, sometimes sha1, whatever, and I happen to like the '-' separators :)  I think sha256 makes a good default, though. 

The other differences are style related and just my personal preference:

  1. optimize for reading instead of writing (I've written and read enough perl in my life to know that it takes effort to make for readable scripts in such a language :)
  2. use scripts instead of functions so you can just add them to your script collection
  3. provide types for your arguments if you require them to be a specific type
  4. check that required arguments are passed

..."

Sorry about the title... It's one of those juvenile jokes in my team (hehehe.. he said "hash"...)

Anyway... This, because of the many hashing algorithms it supports, may come in handy in the future.

No comments:

Post a Comment

NOTE: Anonymous Commenting has been turned off for a while... The comment spammers are just killing me...

ALL comments are moderated. I will review every comment before it will appear on the blog.

Your comment WILL NOT APPEAR UNTIL I approve it. This may take some hours...

I reserve, and will use, the right to not approve ANY comment for ANY reason. I will not usually, but if it's off topic, spam (or even close to spam-like), inflammatory, mean, etc, etc, well... then...

Please see my comment policy for more information if you are interested.

Thanks,
Greg

PS. I am proactively moderating comments. Your comment WILL NOT APPEAR UNTIL I approve it. This may take some hours...