symfony/password-hasher
最新稳定版本:v8.0.0
Composer 安装命令:
composer require symfony/password-hasher
包简介
Provides password hashing utilities
关键字:
README 文档
README
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
统计信息
- 总下载量: 126.17M
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 814
- 点击次数: 1
- 依赖项目数: 76
- 推荐数: 2
其他信息
- 授权协议: MIT
- 更新时间: 2026-01-04