Skip to content

Instantly share code, notes, and snippets.

@tenkoma
Created January 27, 2025 14:47
Show Gist options
  • Save tenkoma/1b6a339bba08598867de2594a16fca8e to your computer and use it in GitHub Desktop.
Save tenkoma/1b6a339bba08598867de2594a16fca8e to your computer and use it in GitHub Desktop.
bcrypthash
[package]
name = "bcrypthash"
version = "0.1.0"
edition = "2021"
[dependencies]
bcrypt = "0.16.0"
fn main() {
let args: Vec<String> = std::env::args().collect();
if args.len() <= 1 {
println!("Please specify a string as an argument.");
return;
}
let hashed = bcrypt::hash(&args[1], bcrypt::DEFAULT_COST).unwrap();
println!("{}", hashed);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment