LaLiga-BackEnd/vendor/symfony/password-hasher
Daniel Guzman 9f30bc98c7 welcome back to dyb-tech 2024-05-18 02:28:01 +02:00
..
Command welcome back to dyb-tech 2024-05-18 02:28:01 +02:00
Exception welcome back to dyb-tech 2024-05-18 02:28:01 +02:00
Hasher welcome back to dyb-tech 2024-05-18 02:28:01 +02:00
CHANGELOG.md welcome back to dyb-tech 2024-05-18 02:28:01 +02:00
LICENSE welcome back to dyb-tech 2024-05-18 02:28:01 +02:00
LegacyPasswordHasherInterface.php welcome back to dyb-tech 2024-05-18 02:28:01 +02:00
PasswordHasherInterface.php welcome back to dyb-tech 2024-05-18 02:28:01 +02:00
README.md welcome back to dyb-tech 2024-05-18 02:28:01 +02:00
composer.json welcome back to dyb-tech 2024-05-18 02:28:01 +02: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