Add to the dependencies
section in your Cargo.toml
:
toml
libcrypt-rs = "0.1.2"
cargo
has cool feature for generating documentation:
- Run
sh
cargo doc
- Open in web browser target/doc/libcrypt_rs/index.html
```rs use libcrypt_rs::{Crypt, Encryptions};
fn main() { let mut crypt_engine = Crypt::new();
crypt_engine.gen_salt(Encryptions::Sha256).expect("Salt generating failed");
crypt_engine.encrypt("1234".to_string()).expect("Encryption failed");
println!("Encrypted data: {}", crypt_engine.encrypted);
} ```