graph_fs 0.1.5

A CLI tool that helps query a local or remote file system by a GraphQL interface
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
extern crate bcrypt;

use bcrypt::{hash, verify, BcryptError};
const DEFAULT_COST: u32 = 8;

pub fn encrypt_password(password: &str) -> Result<String, BcryptError> {
    let hashed = hash(password, DEFAULT_COST)?;
    Ok(hashed)
}

pub fn compare_password(user_password: &str, given_password: &str) -> Result<bool, BcryptError> {
    let valid = verify(given_password, user_password)?;
    Ok(valid)
}