From: Frederick Cheung Date: 2008-02-06T18:49:29+09:00 Subject: Re: Strange characters... how are they created? On 6 Feb 2008, at 08:31, Daniel Waite wrote: > This isn't a Ruby-specific question, I suppose, but it's the language > I'm using for this project so I figured I'd ask here. > > I've created a .torrent file, and between the bencoding is a > representation of the contents of the file I want to share (a small > text > file): > > 20:Ÿø\îµÊ^Ω¬ ‡m$æÉ* ú0* > > My question is, how does the BT client go from plain text to that? The > BT protocol spec says that pieces of data get SHA1'd, but I've never > seen a SHA1 hash look like that. 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. Fred > > > What am I missing? > > In case the sample characters I pasted don't show up right, here's a > screen shot: > > http://rabbitcreative.com/strange-charas.png > -- > Posted via http://www.ruby-forum.com/. >