PHP code example of averay / password-validator
1. Go to this page and download the library: Download averay/password-validator library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
averay / password-validator example snippets
$passwordValidator = new \Averay\PasswordValidator\PasswordValidator();
$hash = $passwordValidator->hash('secret value');
if ($passwordValidator->verify('secret value', $hash)) {
echo '✅ Correct';
} else {
echo '❌ Incorrect';
}
$passwordValidator = new \Averay\PasswordValidator\PasswordValidator(
\PASSWORD_ARGON2I,
['memory_cost' => 2 ^ 32, 'time_cost' => 10],
);