Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/badboy/nom-bencode
https://github.com/badboy/nom-bencode
Last synced: 9 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/badboy/nom-bencode
- Owner: badboy
- Created: 2015-11-23T13:06:44.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-11-23T13:32:47.000Z (about 9 years ago)
- Last Synced: 2024-12-24T02:01:30.892Z (12 days ago)
- Language: Rust
- Size: 2.93 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Bencode parser
[Bencode][bencoding] is the format used in Bittorrent files.
It's a very simplistic format.
All it knows about are strings, integers, lists and dictionaries (also known as hash maps).Using [nom][] I wrote a small parser able to parse all this.
```rust
let data = "l5:jelly4:cake7:custarde".as_bytes();
let obj = bencode::value(data);
```[bencoding]: https://wiki.theory.org/BitTorrentSpecification#Bencoding
[nom]: https://github.com/Geal/nom