Bencode
A zero dependency bencode parsing library.
Usage + Examples
check out examples/ubuntu_torrent.rs
cargo run --example ubuntu_torrent
// get your torrent file as bytes.
let ubuntu_torrent_file: = read.unwrap;
// Bencode::from_bytes will traverse the byte array and read it into a bencode object.
let ubuntu_torrent_bencode: Bencode = from_bytes
// it returns a Result<(Bencode, usize), BencodeError>
.unwrap
// the first item is the Bencode tree,
// the second object is the index of the last parsed byte.
.0;
Roadmap
- Publish bencode lib as a standalone library on crates.
- Publish bien as a commandline tool.
- Optimize the bencode parser, (for fun and profit)
- setup some sort of CI build with metrics.
- (Maybe) Try to get bien published into some sort of package manager ... ?
- Investigate if this is a lot of work.
Todo List
- Create File Structure
- Create Parser Functions
- Integer value parser
- ByteString value parser
- List parser
- Nested List support & tests
- Dictionary parser
- Nested Dict support & tests
- Implement proper errors, not just
panic!
AKA: Don't Panic- Add (un)happy path testing to assert proper error values.
- Add useful messages and metadata to the error types.
- Add a whole bunch of edge case tests
- then do a bug scrub