final class BcryptHasher implements Hasher

Bcrypt implementation of the Hasher contract.

Properties

private int $cost

Methods

__construct(int $cost = 12)

No description

string
make(string $value)

No description

bool
needsRehash(string $hashed)

No description

bool
verify(string $value, string $hashed)

No description

Details

at line 17
__construct(int $cost = 12)

No description

Parameters

int $cost

The bcrypt work factor (4–31). Higher is slower/safer.

at line 25
string make(string $value)

No description

Parameters

string $value

The plain-text value to hash.

Return Value

string

The resulting hash, suitable for storage.

at line 37
bool needsRehash(string $hashed)

No description

Parameters

string $hashed

The existing hash to examine.

Return Value

bool

True if the value should be re-hashed with the current settings, otherwise false.

at line 46
bool verify(string $value, string $hashed)

No description

Parameters

string $value

The plain-text value to check.

string $hashed

The hash to check against.

Return Value

bool

True if the value matches the hash, otherwise false.