rlibbencode 0.1.0

Rust Bencode library
Documentation
  • Coverage
  • 0%
    0 out of 58 items documented0 out of 44 items with examples
  • Size
  • Source code size: 42.94 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 10.5 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • sectorrent/rlibbencode
    3 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • DrBrad

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());
}