https://github.com/cympletech/rckad
Efficient and flexible S/Kademlia implementation.
https://github.com/cympletech/rckad
Last synced: 7 months ago
JSON representation
Efficient and flexible S/Kademlia implementation.
- Host: GitHub
- URL: https://github.com/cympletech/rckad
- Owner: CympleTech
- License: apache-2.0
- Created: 2019-06-11T08:02:27.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2020-09-25T08:01:59.000Z (over 5 years ago)
- Last Synced: 2025-06-09T18:49:56.035Z (about 1 year ago)
- Language: Rust
- Size: 22.5 KB
- Stars: 5
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
[](https://crates.io/crates/rckad)
# rckad
Efficient and flexible Kademlia implementation. (no-std)
```rust
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));
}
```
- [Kademlia](https://pdos.csail.mit.edu/~petar/papers/maymounkov-kademlia-lncs.pdf)
- [S/Kademlia](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.68.4986&rep=rep1&type=pdf)
## License
This project is licensed under, it's your choice.
* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or
http://www.apache.org/licenses/LICENSE-2.0)
* MIT license ([LICENSE-MIT](LICENSE-MIT) or
http://opensource.org/licenses/MIT)