pear/text_password
最新稳定版本:1.2.2
Composer 安装命令:
composer require pear/text_password
包简介
More info available on: http://pear.php.net/package/Text_Password
README 文档
README
Class that provides various types of password generation.
Usage
Generating passwords is a very common task in web applications. This package provides an easy-to-use and intuitive API to generate:
- pronounceable passwords
- unpronounceable passwords
- passwords based on a given string
For the last point, multiple, simple obfuscation algorithms are supported.
Creating a Pronouncable Password
<?php require_once 'Text/Password.php'; // Create pronouncable password of 10 characters. echo Text_Password::create() . "\n"; // Create 3 different pronouncable passwords of length 8. print_r(Text_Password::createMultiple(3, 8)); ?>
Creating an Unpronouncable Password
<?php require_once 'Text/Password.php'; // Create unpronounceable password of length 8 with a, b, and c as // possible characters. echo Text_Password::create(8, 'unpronounceable', 'abc') . "\n"; // Create 4 different unpronounceable passwords of length 10. print_r(Text_Password::createMultiple(4, 10, 'unpronounceable')); // Creating unpronounceable password of 8 chars with only alphanumeric // characters. Other classes that can be specified are 'numeric', 'alphabetic' // and '' for all characters. echo Text_Password::create(8, 'unpronounceable', 'alphanumeric') . "\n"; ?>
Creating passwords based on a given string:
<?php require_once 'Text/Password.php'; // Create password from login 'olivier', type is 'reverse'. Other supported // types are: // // - 'rot13' // - 'rotx' // - 'rotx++', // - 'rotx--', // - 'xor', // - 'ascii_rotx', // - 'ascii_rotx++', // - 'ascii_rotx--', // - 'shuffle', echo Text_Password::createFromLogin('olivier', 'reverse') . "\n"; // Create multiple passwords from array of logins. $logins = array('olivier', 'martin', 'vanhoucke', 'jansen'); print_r(Text_Password::createMultipleFromLogin($logins, 'reverse')); ?>
Installation
PEAR
pear install Text_Password
Composer
./composer.phar require pear/text_password Links
pear/text_password 适用场景与选型建议
pear/text_password 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 125.53k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2026 年 01 月 04 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 pear/text_password 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 pear/text_password 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 125.53k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 22
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-01-04