password_get_info
laravel/framework
Supported Versions: PHP 5 >= 5.5.0, PHP 7, PHP 8
Returns information about the given hash
password_get_info
(
string $hash
): array
public function
info
(
$hashedValue
)
{
return
password_get_info
(
$hashedValue
);
}
src/Illuminate/Hashing/AbstractHasher.php
$this
->
assertTrue
(
$hasher
->
check
(
'password'
,
$value
));
$this
->
assertFalse
(
$hasher
->
needsRehash
(
$value
));
$this
->
assertTrue
(
$hasher
->
needsRehash
(
$value
, [
'rounds'
=>
1
]));
$this
->
assertSame
(
'bcrypt'
,
password_get_info
(
$value
)[
'algoName'
]);
}
public function
testBasicArgon2iHashing
()
tests/Hashing/HasherTest.php
$this
->
assertTrue
(
$hasher
->
check
(
'password'
,
$value
));
$this
->
assertFalse
(
$hasher
->
needsRehash
(
$value
));
$this
->
assertTrue
(
$hasher
->
needsRehash
(
$value
, [
'threads'
=>
1
]));
$this
->
assertSame
(
'argon2i'
,
password_get_info
(
$value
)[
'algoName'
]);
}
public function
testBasicArgon2idHashing
()
tests/Hashing/HasherTest.php
$this
->
assertTrue
(
$hasher
->
check
(
'password'
,
$value
));
$this
->
assertFalse
(
$hasher
->
needsRehash
(
$value
));
$this
->
assertTrue
(
$hasher
->
needsRehash
(
$value
, [
'threads'
=>
1
]));
$this
->
assertSame
(
'argon2id'
,
password_get_info
(
$value
)[
'algoName'
]);
}
tests/Hashing/HasherTest.php