Monday, February 20, 2006

Ruby Encrypt/Encode using digest/sha1

To encode strings:

Digest::SHA1.hexdigest "frankmash.blogspot.com"
=> "443072b4f12ca8796d901d5dce40924ef3c414fd"

1 Comments:

At 11:27 AM, Blogger daniel said...

To clarify, a DIGEST is neither an encryption or an encoding. Rather it's just a unique string based on a calculated mixing-up of the original text. You can't decrypt or decode a digest. Think of it as a FINGERPRINT of the seed text.

 

Post a Comment

<< Home

eXTReMe Tracker