News:

Wieners, Brats, Franks, we've got 'em all.

Main Menu

torrent related coding - bdecoding

Started by warz, April 04, 2007, 09:21:38 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

warz

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