#bencode #serialization #serde #deserialize #bittorrent

serde_bencode

A Serde backed Bencode encoding/decoding library for Rust

9 releases

0.2.4 Oct 9, 2023
0.2.3 Dec 1, 2020
0.2.2 Jul 17, 2020
0.2.1 Feb 10, 2020
0.1.1 Dec 21, 2016

#178 in Encoding

Download history 731/week @ 2023-12-14 789/week @ 2023-12-21 857/week @ 2023-12-28 1027/week @ 2024-01-04 1098/week @ 2024-01-11 1336/week @ 2024-01-18 1372/week @ 2024-01-25 908/week @ 2024-02-01 1427/week @ 2024-02-08 1180/week @ 2024-02-15 1240/week @ 2024-02-22 1077/week @ 2024-02-29 1364/week @ 2024-03-07 1665/week @ 2024-03-14 1426/week @ 2024-03-21 1002/week @ 2024-03-28

5,566 downloads per month
Used in 22 crates (16 directly)

MIT license

65KB
1.5K SLoC

Serde Bencode

Checking Formatting Testing Benchmarking Coverage Crates.io docs.rs

A Serde backed Bencode encoding/decoding library for Rust.

Installation

Add the following to your Cargo.toml:

[dependencies]
serde_bencode = "^0.2.4"
serde = "^1.0.0"
serde_derive = "^1.0.0"

Usage

This is an abbreviated .torrent parsing example from examples/parse_torrent.rs. If you compile this crate as a binary, it will print metadata for any Torrent sent to stdin.

Benchmarking

cargo bench

Dependencies

~140–385KB