Skip to content

Instantly share code, notes, and snippets.

@epequeno
Last active January 23, 2018 12:45
Show Gist options
  • Save epequeno/703d039ef7da1cfcf3ac6f431c3bd02a to your computer and use it in GitHub Desktop.
Save epequeno/703d039ef7da1cfcf3ac6f431c3bd02a to your computer and use it in GitHub Desktop.
bcrypt in rust
extern crate bcrypt;
use bcrypt::{DEFAULT_COST, hash, verify};
fn main() {
let hashed = hash("hunter2", DEFAULT_COST).unwrap();
let valid = verify("hunter2", &hashed);
println!("{:?}", hashed);
println!("{:?}", valid);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment