componenta/password 问题修复 & 功能扩展

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

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

componenta/password

Composer 安装命令:

composer require componenta/password

包简介

Password hashing contract and default implementation

README 文档

README

Password hashing contract and default implementation backed by PHP's native password API.

Use this package when application code should depend on a small password-hashing abstraction instead of calling password_hash() and password_verify() directly.

Installation

composer require componenta/password

Related Packages

Package Why it matters here
componenta/auth Uses PasswordHasherInterface in password-login strategies.
componenta/validation Validates password length/complexity before hashing.
componenta/di Can bind PasswordHasherInterface in the application container.

Usage

use Componenta\Stdlib\PasswordHasher;

$hasher = new PasswordHasher(options: ['cost' => 12]);

$hash = $hasher->hash('secret');

$hasher->verify('secret', $hash); // true
$hasher->needsRehash($hash);      // false when algorithm/options still match

Contract

PasswordHasherInterface exposes:

  • hash(string $password): string
  • verify(string $password, string $hash): bool

The default PasswordHasher additionally exposes needsRehash(string $hash): bool so applications can migrate stored hashes when algorithm options change.

Configuration

The constructor accepts:

  • algorithm: passed to PHP's password API
  • options: passed to password_hash() and password_needs_rehash()

Keep policy decisions such as minimum password length and breach checks in validation/application code. This package only hashes and verifies already accepted password strings.

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-06-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固