bencode: BitTorrent Bencode Decoding in Racket
(require (planet neil/bencode:2:0)) |
1 Introduction
String | Racket byte string. |
Integer | Scheme integer. |
List | Scheme list. |
Dictionary | Scheme list with the symbol dictionary as its head, and an association list as its tail. |
> (unbencode (open-input-file "debian.torrent"))
((dictionary |
(#"announce" . #"http://cdimage.debian.org:6969/announce") |
(#"comment" . #"Debian CD from cdimage.debian.org") |
(#"creation date" . 1105009474) |
(#"info" |
dictionary |
(#"length" . 600158208) |
(#"name" . #"debian-30r4-i386-binary-1.iso") |
(#"piece length" . 524288) |
(#"pieces" . [...large byte string...])))) |
2 API
3 History
- PLaneT 2:0 —
2012-06-12 Converted to McFly. Changed package home page URL. - Version 0.2 —
PLaneT 1:1 — 2009-03-03 Library is now LPGL 3. Converted to author’s new Scheme administration system. - Version 0.1 —
PLaneT 1:0 — 2005-04-17 Initial release.
4 Legal
Copyright (c) 2005, 2009, 2012 Neil Van Dyke. This program is Free Software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. See http://www.gnu.org/licenses/ for details. For other licenses and consulting, please contact the author.