Documentation

BcryptHasher
in package
implements Hasher

Interfaces, Classes and Traits

Hasher

Table of Contents

$rounds  : int
Default crypt cost factor.
check()  : bool
Check the given plain value against a hash.
make()  : string
Hash the given value.
needsRehash()  : bool
Check if the given hash has been hashed using the given options.
setRounds()  : $this
Set the default password work factor.
cost()  : int
Extract the cost value from the options array.

Properties

$rounds

Default crypt cost factor.

protected int $rounds = 10

Methods

check()

Check the given plain value against a hash.

public check(string $value, string $hashedValue[, array<string|int, mixed> $options = [] ]) : bool
Parameters
$value : string
$hashedValue : string
$options : array<string|int, mixed> = []
Return values
bool

make()

Hash the given value.

public make(string $value[, array<string|int, mixed> $options = [] ]) : string
Parameters
$value : string
$options : array<string|int, mixed> = []
Tags
throws
RuntimeException
Return values
string

needsRehash()

Check if the given hash has been hashed using the given options.

public needsRehash(string $hashedValue[, array<string|int, mixed> $options = [] ]) : bool
Parameters
$hashedValue : string
$options : array<string|int, mixed> = []
Return values
bool

setRounds()

Set the default password work factor.

public setRounds(int $rounds) : $this
Parameters
$rounds : int
Return values
$this

cost()

Extract the cost value from the options array.

protected cost([array<string|int, mixed> $options = [] ]) : int
Parameters
$options : array<string|int, mixed> = []
Return values
int

Search results