class BcryptHasher extends AbstractHasher implements Hasher (View source)

Properties

protected int $rounds

The default cost factor.

protected bool $verifyAlgorithm

Indicates whether to perform an algorithm check.

Methods

array
info(string $hashedValue)

Get information about the given hashed value.

bool
check(string $value, string $hashedValue, array $options = [])

Check the given plain value against a hash.

void
__construct(array $options = [])

Create a new hasher instance.

string
make(string $value, array $options = [])

Hash the given value.

bool
needsRehash(string $hashedValue, array $options = [])

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

verifyConfiguration($value)

Verifies that the configuration is less than or equal to what is configured.

bool
isUsingCorrectAlgorithm(string $hashedValue)

Verify the hashed value's algorithm.

bool
isUsingValidOptions(string $hashedValue)

Verify the hashed value's options.

$this
setRounds(int $rounds)

Set the default password work factor.

int
cost(array $options = [])

Extract the cost value from the options array.

Details

array info(string $hashedValue)

Get information about the given hashed value.

Parameters

string $hashedValue

Return Value

array

bool check(string $value, string $hashedValue, array $options = [])

Check the given plain value against a hash.

Parameters

string $value
string $hashedValue
array $options

Return Value

bool

Exceptions

RuntimeException

void __construct(array $options = [])

Create a new hasher instance.

Parameters

array $options

Return Value

void

string make(string $value, array $options = [])

Hash the given value.

Parameters

string $value
array $options

Return Value

string

Exceptions

RuntimeException

bool needsRehash(string $hashedValue, array $options = [])

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

Parameters

string $hashedValue
array $options

Return Value

bool

verifyConfiguration($value)

internal  
 

Verifies that the configuration is less than or equal to what is configured.

Parameters

$value

protected bool isUsingCorrectAlgorithm(string $hashedValue)

Verify the hashed value's algorithm.

Parameters

string $hashedValue

Return Value

bool

protected bool isUsingValidOptions(string $hashedValue)

Verify the hashed value's options.

Parameters

string $hashedValue

Return Value

bool

$this setRounds(int $rounds)

Set the default password work factor.

Parameters

int $rounds

Return Value

$this

protected int cost(array $options = [])

Extract the cost value from the options array.

Parameters

array $options

Return Value

int

Laravel Cloud is the best place to deploy Laravel, Nuxt, Express, Hono, Node.js, Bun, Go, Flask, Python, and more, with dedicated infrastructure available on AWS through Laravel Private Cloud.