Created
January 27, 2025 14:47
-
-
Save tenkoma/1b6a339bba08598867de2594a16fca8e to your computer and use it in GitHub Desktop.
bcrypthash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[package] | |
name = "bcrypthash" | |
version = "0.1.0" | |
edition = "2021" | |
[dependencies] | |
bcrypt = "0.16.0" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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