Author Topic: torrent related coding - bdecoding  (Read 1515 times)

0 Members and 1 Guest are viewing this topic.

Offline warz

  • Hero Member
  • *****
  • Posts: 1139
    • View Profile
torrent related coding - bdecoding
« on: April 04, 2007, 09:21:38 pm »
i've decided to work on a torrent download app in my spare time. i was wondering though if anyone here has had any experience programming one of their own. the concept of decoding the bencoded data is a little tough to wrap my mind around without some sort of explanation, or something. it doesn't seem like the dev community for torrent apps is as big as i had imagined, and that there's not many good explanations of how this should work, or theory behind the algorithm, or something.

the documentation regarding bencoded data can be found at both and

and example bencoded .torrent file's contents looks like so...
d8:announce44: by15:Azureus/ datei1174231853e8:encoding5:UTF-84:infod6:lengthi145344e4:name11:TEsting.JPG10:name.utf-811:TEsting.JPG12:piece lengthi32768e6:pieces100:Vö²òeL•¢Ø,µ   _Þ

the general idea is to decode this data into a nested-like structure, or some other easily analyzed arrangement, and then analyze it afterwards. any one have any quality ideas?

edit: i've been thinking about using a map for storage of the key elements pulled from the metainfo files.
« Last Edit: April 04, 2007, 10:54:30 pm by warz » - web based markup debugger