If you find that this library lacks some feature you need, or you have a suggestion for improving it, please don’t hesitate to get in touch with me!
This library implements Bencode, "the encoding used by the peer-to-peer file sharing system BitTorrent for storing and transmitting loosely structured data." Quote from Wikipedia.
Bencode is defined as part of the BitTorrent specifications. Useful references include:
Bencode terms are represented as Racket data structures as follows:
Bencode lists map to Racket lists
Bencode dictionaries map to Racket equal?-hashtables
Bencode integers map to Racket integers
Bencode strings map to Racket byte-vectors (bytes)
In particular, Racket’s null value is the representation of the empty Bencode list.
All the functionality below can be accessed with a single require:
|(require (planet tonyg/bencode:1:=0))|
If a Bencoded string (Racket bytes) value appears on the input-port and has length in excess of bencode-bytes-limit’s current value, an error is signalled.
(bencode-bytes-limit new-limit) → void? new-limit : integer?