ensnared/pwgen 问题修复 & 功能扩展

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

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

ensnared/pwgen

Composer 安装命令:

composer require ensnared/pwgen

包简介

Generate pronounceable random password

README 文档

README

Description

This is a very simple class for creating random pronounceable passwords. By default it also uses special characters and numbers, but this can be disabled. One can also customize the letter combinations that are allowed, as well as character replacements.

Note: This class is not based on, nor does it have anything to do with, other similar projects with the same name.

Requirements

  • PHP 7.4 or newer
  • mbstring extension

Installation

Install with composer:

composer require ensnared/pwgen

Usage

To create a password with default settings, simply use Password::create();.

By default, the passwords generated will be between 8 and 12 characters long, and will include at least 2 special characters and 2 digits.

Configuration

The behaviour can be configured with the methods below. All these methods also have an equivalent get-method.

  • Password::setConsonants()
    • Set list of consonants used in password creation.
    • Default is all consonants in the english alphabet.
  • Password::setDigits()
    • Set number of digits to add to end of password.
    • Default is 2.
  • Password::setDoubleConsonantsAfterVowel()
    • Set the list of double consonants that will only be used after a vowel in a password.
  • Password::setDoubleConsonantsAnywhere()
    • Set the list of double consonants that can be used anywhere in a password.
  • Password::setDoubleConsonantsFirst()
    • Set the list of double consonants that will only be used in the beginning of a password.
  • Password::setDoubleVowelsAfterConsonant()
    • Set the list of double vowels that will only be used after a consonant in a password.
  • Password::setDoubleVowelsAnywhere()
    • Set the list of double vowels that can be used anywhere in a password.
  • Password::setDoubleVowelsFirst()
    • Set the list of double vowels that will only be used in the beginning of a password.
  • Password::setMaxLength()
    • Set the maximum length of generated passwords.
    • Default is 12
    • Note that this is not a hard limit, in some cases a password might be 1-2 characters longer, depending on wether warping and special characters are in use.
  • Password::setMinLength()
    • Set the minimum length of generated passwords.
    • Default is 8
    • Note that this is not a hard limit, in some cases a password might be 1-2 characters shorter, depending on wether warping and special characters are in use.
  • Password::setNumSpecialChars()
    • Set number of special characters in a password.
    • Default is 1.
    • Set to 0 to disable.
    • If warping is used, warped characters that result in special characters will still be warped even if you set this to 0. If not 0, warped special characters will count towards this number.
  • Password::setRareCharacters()
    • Set the list of rare characters that only has a percentage chance of being used.
    • Default is l, q, w, x, z
  • Password::setRareCharactersChance()
    • Set the percentile chance of rare characters being used.
    • Default is 30.
    • Set to 0 to prevent rare characters from ever being used.
    • Set to 100 to disable the functionality.
  • Password::setSpecialChars()
    • Set list of special characters used in password creation.
    • Default is !@#$%&*-+?
  • Password::setVowels()
    • Set list of vowels used in password creation
    • Default is all vowels in the english alphabet.
  • Password::setWarpCharactersChance()
    • Set the percentile chance of characters being replaced as defined by getWarpCharactersMap().
    • Default is 75.
    • Set to 0 to disable warping.
    • Set to 100 to always warp.
  • Password::setWarpCharactersMap()
    • Set the map of characters to be warped (replaced).

LICENSE

MIT

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-06-30

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固