Skip to content

Efficient and flexible S/Kademlia implementation.

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

CympleTech/rckad

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Latest Version

rckad

Efficient and flexible Kademlia implementation. (no-std)

use rckad::KadTree;

fn main() {
    let mut kad = KadTree::new(0, "0");
    kad.add(2, "b");
    kad.add(3, "c");
    kad.add(4, "e");

    assert_eq!(Some((&2, &"b", true)), kad.search(&2));
    assert_eq!(true, kad.contains(&2));

    kad.remove(&2);
    assert_eq!(false, kad.contains(&2));

    let mut kad = KadTree::with_k_bucket(0, "0".to_owned(), 2);

    for i in 1..(256 * 2 + 2) {
        kad.add(i, format!("{}", i));
    }

    assert_eq!(Some((&26, &"26".to_owned(), false)), kad.search(&14));
}

License

This project is licensed under, it's your choice.

About

Efficient and flexible S/Kademlia implementation.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages