eureka/component-password
Composer 安装命令:
composer require eureka/component-password
包简介
PHP password library.
README 文档
README
Generate, hash & verify secure password.
Usage
Composer
composer require "eureka/component-password"
Password Generator
<?php use Eureka\Component\Password\PasswordGenerator; use Eureka\Component\Password\StringGenerator; //~ Use service generator $length = 16; // default $alpha = 0.6; // default $numeric = 0.2; // default $special = 0.2; // default $generator = new PasswordGenerator( new StringGenerator() ); $password = $generator->generate($length, $alpha, $numeric, $special); echo $password->getPlain() . PHP_EOL; echo $password->getHash() . PHP_EOL;
Password
<?php use Eureka\Component\Password\Password; //~ Just define password $password = new Password('mySecretPassword'); echo $password->getHash() . PHP_EOL; echo $password->getPlain() . PHP_EOL;
PasswordChecker
<?php use Eureka\Component\Password\PasswordChecker; //~ Just define password $passwordChecker = new PasswordChecker(); $passwordPlain = 'mypassword'; // From login form $passwordHash = '...'; // Retrieved from db for example echo 'Is valid password: ' . $passwordChecker->verify($passwordPlain, $passwordHash) . PHP_EOL;
Script - Password Generator
vendor/bin/console password/script/generator --help
will output this:
Use : bin/console Eureka\Component\Password\Script\Generator [OPTION]... OPTIONS: -g, --generate Generate password -l ARG, --length=ARG Password length -a ARG, --ratio-alpha=ARG Alphabetic latin characters ratio -n ARG, --ratio-numeric=ARG Numeric characters ratio -o ARG, --ratio-other=ARG Other characters ratio
Contributing
See the CONTRIBUTING file.
Install / update project
You can install project with the following command:
make install
And update with the following command:
make update
NB: For the components, the composer.lock file is not committed.
Testing & CI (Continuous Integration)
Tests
You can run unit tests (with coverage) on your side with following command:
make php/tests
You can run integration tests (without coverage) on your side with following command:
make php/integration
For prettier output (but without coverage), you can use the following command:
make php/testdox # run tests without coverage reports but with prettified output
Code Style
You also can run code style check with following commands:
make php/check
You also can run code style fixes with following commands:
make php/fix
Check for missing explicit dependencies
You can check if any explicit dependency is missing with the following command:
make php/deps
Static Analysis
To perform a static analyze of your code (with phpstan, lvl 9 at default), you can use the following command:
make php/analyse
To ensure you code still compatible with current supported version at Deezer and futures versions of php, you need to run the following commands (both are required for full support):
Minimal supported version:
make php/min-compatibility
Maximal supported version:
make php/max-compatibility
CI Simulation
And the last "helper" commands, you can run before commit and push, is:
make ci
License
This project is currently under The MIT License (MIT). See LICENCE file for more information.
eureka/component-password 适用场景与选型建议
eureka/component-password 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 442 次下载、GitHub Stars 达 0, 最近一次更新时间为 2016 年 06 月 27 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 eureka/component-password 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 eureka/component-password 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 442
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 21
- 依赖项目数: 3
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-06-27