https://github.com/nomyfan/bencodex
Bencode parser
https://github.com/nomyfan/bencodex
bencode bencode-parser rust rust-crate rust-library
Last synced: 2 months ago
JSON representation
Bencode parser
- Host: GitHub
- URL: https://github.com/nomyfan/bencodex
- Owner: nomyfan
- License: mit
- Created: 2020-04-13T07:54:02.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-09-25T23:48:53.000Z (over 1 year ago)
- Last Synced: 2025-02-28T05:53:15.327Z (3 months ago)
- Topics: bencode, bencode-parser, rust, rust-crate, rust-library
- Language: Rust
- Homepage: https://docs.rs/bencodex
- Size: 17.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# bencodex
A bencode parser.
## Get Started
```rust
use bencodex::{BDict, BNode};let mut dict = BDict::new();
dict.insert("bar".to_string(), "spam".into());
dict.insert("foo".to_string(), 42.into());let bnode = BNode::Dict(dict);
let mut file = File::create(
env::current_dir().unwrap().join("name.torrent")
).unwrap();
bnode.serialize(&mut file).unwrap();
```