Crates.io | evolvingstring |
lib.rs | evolvingstring |
version | 0.1.0 |
source | src |
created_at | 2023-11-19 06:24:46.88651 |
updated_at | 2023-11-19 06:24:46.88651 |
description | A Rust crate for creating evolving strings based on SHA256, with serialization and time-based prediction capabilities. |
homepage | |
repository | https://github.com/mcfearsome/rust-evolvingstring |
max_upload_size | |
id | 1040938 |
size | 23,423 |
The EvolvingString library is a Rust crate that provides functionalities for creating and managing evolving strings, where the evolution of the string is determined by a SHA256 hash function based on an initial string, a secret, and a time interval.
To use the EvolvingString library in your Rust project, add the following to your Cargo.toml
file under [dependencies]
:
evolvingstring = "0.1.0"
You can then create an EvolvingString instance and use its methods as follows:
use evolvingstring::EvolvingString;
let es = EvolvingString::new("initial value", "secret key", 60);
let current_state = es.current();
let predicted_state = es.predict(120);
let b64_encoded = es.to_base64();
let es_from_b64 = EvolvingString::from_base64(&b64_encoded).unwrap();
Replace "initial value" and "secret key" with your own initial string and secret, and choose an appropriate interval in seconds for the evolution of the string.
The library comes with an extensive suite of tests to ensure the correctness of the implemented features. You can run the tests using the cargo test
command.
EvolvingString is maintained by Jesse McPherson (jesse@mcfearsome.dev). For any questions or contributions, please contact the author directly.
This project is licensed under the MIT License - see the LICENSE file for details.