rc_protocol 1.0.0

Rust implementation of the Random Checksum Protocol
Documentation
  • Coverage
  • 63.64%
    7 out of 11 items documented0 out of 5 items with examples
  • Size
  • Source code size: 21.82 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.65 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 16s Average build duration of successful builds.
  • all releases: 16s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • gammelalf/rcp-rs
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • gammelalf

rcp-rs

Implemention of RCP in rust

Usage

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