libxcrypt-rs
Rust bindings for libxcrypt
Usage
Add xcrypt
to your Cargo.toml
:
Hash a phrase with the best available hashing method and default parameters:
use ;
Rust bindings for libxcrypt
Add xcrypt
to your Cargo.toml
:
cargo add xcrypt
Hash a phrase with the best available hashing method and default parameters:
use xcrypt::{crypt, crypt_gensalt};
fn main() {
let setting = crypt_gensalt(None, 0, None).unwrap();
let hashed_phrase = crypt("hello", &setting).unwrap();
println!("{hashed_phrase}");
}