boutmad/randompassword
Composer 安装命令:
composer require boutmad/randompassword
包简介
A package for generating random passwords
README 文档
README
A simple PHP package for generating random passwords with customizable options. Whether you need a secure password for your application or just want to test your systems, this package has got you covered! 🔐
✨ Features
- Generate a single random password with a specified length.
- Generate multiple random passwords at once for bulk usage.
- Options to include special characters for added security.
- Customizable length and character set to fit your needs.
🛠️ Usage
Here’s a simple example of how to use the RandomPasswordGenerator package in your PHP application:
require_once 'vendor/autoload.php'; use RandomPasswordGenerator\RandomPasswordGenerator; // Create an instance of the password generator $passwordGenerator = new RandomPasswordGenerator(12, true); // 12 characters with special chars // Generate a single password echo "Generated Password: " . $passwordGenerator->generatePassword() . "\n"; // Generate multiple passwords $passwords = $passwordGenerator->generateMultiplePasswords(5); echo "Generated Passwords: \n"; print_r($passwords);
📝 Configuration Options
You can customize the password generation by providing different parameters:
- Length: Specify the length of the password (e.g., 8, 12, 16).
- Special Characters: Set to
trueorfalseto include or exclude special characters.
🛠️ Installation
To install the boutmad/randompassword package using Composer, follow these steps:
- Run the following Composer command to install the package in your project:
composer require boutmad/randompassword
Note: If you encounter issues with stability, make sure your composer.json allows for dev versions by adding this to your composer.json:
{
"minimum-stability": "dev",
"prefer-stable": true
}
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-10-11