xcrypt

Crates.ioxcrypt
lib.rsxcrypt
version0.3.2
created_at2024-10-09 13:27:16.502478+00
updated_at2025-09-16 15:06:50.194363+00
descriptionBindings for libxcrypt
homepagehttps://github.com/nikstur/libxcrypt-rs
repositoryhttps://github.com/nikstur/libxcrypt-rs
max_upload_size
id1402386
size18,606
(nikstur)

documentation

README

libxcrypt-rs

Rust bindings for libxcrypt

Usage

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

Contributing

You should run cargo-valgrind on the tests to ensure we do not leak memory:

cargo valgrind tests
Commit count: 50

cargo fmt