#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

#170 in Encoding

Download history 1222/week @ 2024-01-08 1103/week @ 2024-01-15 1239/week @ 2024-01-22 1263/week @ 2024-01-29 1321/week @ 2024-02-05 975/week @ 2024-02-12 1542/week @ 2024-02-19 1012/week @ 2024-02-26 1102/week @ 2024-03-04 1558/week @ 2024-03-11 1631/week @ 2024-03-18 1252/week @ 2024-03-25 1299/week @ 2024-04-01 1459/week @ 2024-04-08 1423/week @ 2024-04-15 1109/week @ 2024-04-22

5,366 downloads per month
Used in 23 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

~145–385KB