rlibbencode

Crates.iorlibbencode
lib.rsrlibbencode
version0.1.0
created_at2025-06-25 19:55:19.800519+00
updated_at2025-06-25 19:55:19.800519+00
descriptionRust Bencode library
homepage
repositoryhttps://github.com/sectorrent/rlibbencode
max_upload_size
id1726349
size43,435
Brad (DrBrad)

documentation

README

rlibbencode

This is an implementation of Bencode for Rust. Bencode is used for DHTs, Torrents, and Google DataServers. Its a lightweight fast data serialization. Wikipedia

I have also made an implementation of Bencode with Java.

Usage

Here are some examples of how to use the Bencode library.

Bencode

use crate::variables::bencode_variable::Bencode;
use crate::variables::bencode_object::{BencodeObject, PutObject};

fn main() {
    let d  = b"d1:v5:0.1.0e";
    let mut x = bencode!({
        "name": "Edward",
        "t": "TEST",
        "b": [
            "a",
            12307123,
            {
                "no": 123
            }
        ],
        "p": d
    });
    
    println!("{}", x.to_bencode());
}
Commit count: 0

cargo fmt