定制 hosteurope/password-generator 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

hosteurope/password-generator

Composer 安装命令:

composer require hosteurope/password-generator

包简介

Password generator for generating policy-compliant passwords.

README 文档

README

This password generator will generate random passwords which will comply the given password policy.

Usage

Require this project using composer. This will make it available for your project.

composer require hosteurope/password-generator

Don't forget to require the composer autoloader, if not already done:

require 'vendor/autoload.php';

Then, to use the password generator, just create a new instance and set the requirements.

In this example, we require the password to be 16 characters in length, including at least four lowercase characters, one uppercase character, two numbers and one symbol.

$generator = new \PasswordGenerator\Generator;
$generator->requireLowercase(4)
    ->requireUppercase(1)
    ->requireNumber(2)
    ->requireSymbol(1)
    ->length(16);

var_dump($generator->get()); // string(16) "ZE0ff_Rgb6uGq28w"

var_dump($generator->get()); // string(16) "r5zRLn+8o#(gGffa"

Custom Character Types

If you're not satisfied with the given character types, feel free to add your own class.

Requirements are to extend the PasswordGenerator\Characters\GenericCharacter class. Then, add a new instance of that object to the desired Generator using

$generator->addCharacterType('myCharacterType', $customCharacterType);

You then can require and use them just as before:

$generator->requireMyCharacterType(1);

License

This library is published under the MIT license. See LICENSE for more information.

Copyright (c) 2016 Host Europe Group Ltd.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-10-10

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固