libcrypt-rs 0.1.2

rust binding for POSIX crypt library (libcrypt)
Documentation
  • Coverage
  • 62.96%
    17 out of 27 items documented5 out of 9 items with examples
  • Size
  • Source code size: 8.81 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.82 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • Zapomnij/libcrypt-rs
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • zapomnij

libcrypt-rs - rust binding for POSIX crypt library (libcrypt)

How to use it

Add to the dependencies section in your Cargo.toml:

libcrypt-rs = "0.1.2"

Documentation

cargo has cool feature for generating documentation:

  • Run
cargo doc
  • Open in web browser target/doc/libcrypt_rs/index.html

Example

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

Notices

  • Do not encrypt multiple data at the same time, otherwise can cause segmentation fault.