Encodes data in the BitTorrent bencode format.