2017 © Pedro Peláez
 

library password-generator

Password generator for generating policy-compliant passwords.

image

hosteurope/password-generator

Password generator for generating policy-compliant passwords.

  • Thursday, December 8, 2016
  • by KarimGeiger
  • Repository
  • 2 Watchers
  • 1 Stars
  • 1,249 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 2 % Grown

The README.md

Password Generator

This password generator will generate random passwords which will comply the given password policy., (*1)

Usage

Require this project using composer. This will make it available for your project., (*2)

composer require hosteurope/password-generator

Don't forget to require the composer autoloader, if not already done:, (*3)

require 'vendor/autoload.php';

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

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., (*5)

$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., (*6)

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

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

You then can require and use them just as before:, (*8)

$generator->requireMyCharacterType(1);

License

This library is published under the MIT license. See LICENSE for more information., (*9)

Copyright (c) 2016 Host Europe Group Ltd., (*10)

The Versions

08/12 2016

dev-master

9999999-dev

Password generator for generating policy-compliant passwords.

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

The Development Requires

by Karim Geiger

08/12 2016

v1.0.1

1.0.1.0

Password generator for generating policy-compliant passwords.

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

The Development Requires

by Karim Geiger

10/10 2016

v1.0

1.0.0.0

Password generator for generating policy-compliant passwords.

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

The Development Requires

by Karim Geiger