Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gammelalf/rcp-rs
Rust implementation of the Random Checksum Protocol
https://github.com/gammelalf/rcp-rs
Last synced: 17 days ago
JSON representation
Rust implementation of the Random Checksum Protocol
- Host: GitHub
- URL: https://github.com/gammelalf/rcp-rs
- Owner: gammelalf
- License: mit
- Created: 2022-08-04T20:32:57.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-08-05T12:11:30.000Z (over 2 years ago)
- Last Synced: 2024-09-15T05:24:42.144Z (2 months ago)
- Language: Rust
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# rcp-rs
Implemention of [RCP](https://github.com/myOmikron/rcp) in rust
## Usage
```rust
use std::collections::HashMap;
use rc_protocol::RCPConfig;// Config is used to create a checksum as well as validate a checksum
let config = RCPConfig {
shared_secret: "Shared Secret Key".to_string(),
use_time_component: true,
time_delta: 5,
};let mut m = HashMap::new();
m.insert("key1", "value1");
m.insert("key2", "value2");// Get the checksum for a given dictionary
let checksum = config.get_checksum(&m, "TestSalt");// Validate a given checksum
if !config.validate_checksum(&m, "TestSalt", &checksum) {
println!("Checksum was incorrect");
}
```