[][src]Crate phpbb_pwhash

A re-implementation of the phpbb_check_hash function (from phpBB 3) in Rust. It allows verifying a salted hash against a password.

Usage

To verify a hash against a password:

use phpbb_pwhash::{check_hash, CheckHashResult};

let hash = "$H$9/O41.qQjQNlleivjbckbSNpfS4xgh0";
assert_eq!(
    check_hash(hash, "pass1234"),
    CheckHashResult::Valid
);
assert_eq!(
    check_hash(hash, "pass1235"),
    CheckHashResult::Invalid
);

Structs

PhpbbHash

A parsed encoded phpBB3 hash

Enums

CheckHashResult

The result type returned by check_hash.

InvalidHash

The error returned if the encoded hash is invalid.

Functions

check_hash

Validate a password against a phpBB3 salted hash.

parse_hash

Parse a phpBB3 hash.