From: Daniel Waite Date: 2008-02-06T19:06:27+09:00 Subject: Re: Strange characters... how are they created? Frederick Cheung wrote: > That sort of depends how you display your SHA1 hash. The result will > just be 20 random looking bytes (as you've got before), which doesn't > display particularly nicely, which is why it's often written out in > hex. However if it's never going to be read by anything approaching a > human you might as well just store the 20 bytes without trying to > encode them in anyway. Wow Frederick, you just opened my eyes! Thank you! You said... > ...which is why it's often written out in hex. And on a whim I tried: Digest::SHA1.digest(...) And lo' and behold, I got much more bizarre looking output: >> Digest::SHA1.digest('d3:cow3:moo4:spam4:eggs') => "?:\231\005?5&&U\203?@\217\261\216?%t" I had no idea there was anything other than the hexdigest method, or that the resulting hash could be represented so differently. I feel like I'm moving forward, but I'm facing the wrong direction by a degree or two. The output, while more similar to what Transmission is generating, isn't quite as "funky." -- Posted via http://www.ruby-forum.com/.