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

0 Members and 1 Guest are viewing this topic.

Offline warz

  • Hero Member
  • *****
  • Posts: 1134
    • View Profile
    • chyea.org
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 bittorrent.org and wiki.theory.org.

and example bencoded .torrent file's contents looks like so...
Quote
d8:announce44:http://vip.tracker.thepiratebay.org/announce13:announce-listll47:http://vip.tracker.thepiratebay.org:80/announceee18:azureus_propertiesd17:dht_backup_enablei1ee7:comment0:13:comment.utf-80:10:created by15:Azureus/2.5.0.413:creation datei1174231853e8:encoding5:UTF-84:infod6:lengthi145344e4:name11:TEsting.JPG10:name.utf-811:TEsting.JPG12:piece lengthi32768e6:pieces100:Vö²òeL•¢Ø,µ   _Þ
K~
žAãmºh¹¡

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 »
http://www.chyea.org/ - web based markup debugger