symfony/password-hasher 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

GitHub 信息

  • Stars: 810
  • Watchers: 3
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04