A zero dependency bencode parser and encoder written in rust.
Want to use benko for Torrents? check out tijb/torq
Check out the docs. docs.rs/benko
read from a file
rust
let bytes: Vec<u8> = std::fs::read("my_file.torrent")
.expect("Couldn't read file.");
let bencode: Benc = Benc::parse(bytes);
encode to bytes
rust
let bencode: Benc = Benc::Int(9001);
let bytes: Vec<u8> = bencode.bytes();
Feel free to put up a Pull Request, or open an Issue. :)