Thursday, October 3, 2013

To compute a hash of a string


On Linux, to compute the SHA1 for a string "my_string", run:
   $ echo -n "my_string" | openssl dgst -sha1

To compute the SHA-256, run:
   $ echo -n "my_string" | openssl dgst -sha256

To compute the MD5, run:
   $ echo -n "my_string" | openssl dgst -md5

etc...




No comments:

 
Get This <