A simple and efficient Bencode encoder/decoder. π οΈ
Bencode is the encoding format used by the BitTorrent protocol for storing and transmitting data. This repository provides a lightweight implementation for encoding and decoding Bencoded data. π
- β Encode Python data structures (dict, list, int, bytes) into Bencode format.
- β Decode Bencoded data back into Python objects.
- β Simple and efficient implementation. β‘
Clone the repository:
$ git clone https://github.com/yourusername/bencode-parser.git
$ cd bencode-parserfrom bencode import Encoder
data = {"key": "value", "number": 42, "list": [1, 2, 3]}
Encoder(data).encode()from bencode import Decoder
data = b"d3:key5:value6:numberi42e4:listli1ei2ei3ee"
Decoder(data).decode()This project is licensed under the MIT License. See LICENSE for details. π
0youcef β¨