EthikTag/vendor/symfony/password-hasher
Rudy b21f2bc04b conteneurisation de l'appli 2023-01-07 22:07:15 +01:00
..
Command conteneurisation de l'appli 2023-01-07 22:07:15 +01:00
Exception conteneurisation de l'appli 2023-01-07 22:07:15 +01:00
Hasher conteneurisation de l'appli 2023-01-07 22:07:15 +01:00
CHANGELOG.md conteneurisation de l'appli 2023-01-07 22:07:15 +01:00
LICENSE conteneurisation de l'appli 2023-01-07 22:07:15 +01:00
LegacyPasswordHasherInterface.php conteneurisation de l'appli 2023-01-07 22:07:15 +01:00
PasswordHasherInterface.php conteneurisation de l'appli 2023-01-07 22:07:15 +01:00
README.md conteneurisation de l'appli 2023-01-07 22:07:15 +01:00
composer.json conteneurisation de l'appli 2023-01-07 22:07:15 +01:00

README.md

PasswordHasher Component

The PasswordHasher component provides secure password hashing utilities.

Getting Started

$ composer require symfony/password-hasher
use Symfony\Component\PasswordHasher\Hasher\PasswordHasherFactory;

// Configure different password hashers via the factory
$factory = new PasswordHasherFactory([
    'common' => ['algorithm' => 'bcrypt'],
    'memory-hard' => ['algorithm' => 'sodium'],
]);

// Retrieve the right password hasher by its name
$passwordHasher = $factory->getPasswordHasher('common');

// Hash a plain password
$hash = $passwordHasher->hash('plain'); // returns a bcrypt hash

// Verify that a given plain password matches the hash
$passwordHasher->verify($hash, 'wrong'); // returns false
$passwordHasher->verify($hash, 'plain'); // returns true (valid)

Resources