Function pwhash::bcrypt::hash_with
[−]
[src]
pub fn hash_with<'a, IBS, B>(param: IBS, pass: B) -> Result<String> where
IBS: IntoBcryptSetup<'a>,
B: AsRef<[u8]>,
Hash a password with user-provided parameters.
Bcrypt has its own setup struct because of the additional variant
field. An ordinary HashSetup
can be converted into BcryptSetup
, which
will set the variant to default. The Default
trait is implemented for
BcryptSetup
, which makes it easier to initialize just the desired
fields (see the module-level example.)