PHP Classes

PHP Passcode and Password Generator: Generate password strings that follow rules

Recommend this page to a friend!
  Info   View files Documentation   View files View files (11)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 60 All time: 10,460 This week: 673Up
Version License PHP version Categories
passcode-password-ge 1.0GNU General Publi...5PHP 5, Text processing, Security
Description 

Author

This package can generate password strings that follow the rules.

It provides one class that can generate a password with a specific length with characters of letters, digits, and optional symbol characters.

The package also provides another class that can generate passcodes with a specific length that only has digits.

Picture of Pierre-Henry Soria
  Performance   Level  
Name: Pierre-Henry Soria <contact>
Classes: 46 packages by
Country: United Kingdom
Age: 33
All time rank: 37816 in United Kingdom
Week rank: 53 Up2 in United Kingdom Up
Innovation award
Innovation award
Nominee: 17x

Winner: 3x

Documentation

PHP Passcodes & Passwords Generator

? Description

A simple &amp; clean way to generate random passcodes and passwords ?

Ko Fi - Offer Me A Coffee

? Server Requirement

? Installation (with Composer)

composer require ph-7/passcode-password-generator

? Usage

For Passcodes

use PH7\Generator\Passcode;

echo Passcode::generate(10); // Generate a 10-length passcode

By default, without argument, the function will generate a 6-character passcode.

use PH7\Generator\Passcode;

// By default, it generates a 6 length passcode
echo Passcode::generate();


// You can use the public `Passcode::DEFAULT_LENGTH` const, whcih also gives a 6-length passcode
echo Passcode::generate(Passcode::DEFAULT_LENGTH);

For Passwords

use PH7\Generator\Password;

echo Password::generate(16); // Generate a 16-length password

By default, generated passwords will contain special characters. You can disable them by mentioning the second argument to false

use PH7\Generator\Password;

// The password won't contain any special characters such as -, _, ~, |, %, ^, !, $, #, @, and ?
echo Password::generate(Password::DEFAULT_LENGTH, false);

Without argument, the function will generate a 12-character password.

use PH7\Generator\Password;

// By default, it generates a 12-length password
echo Password::generate();


// Password::DEFAULT_LENGTH also gives a 12-length password
echo Password::generate(Password::DEFAULT_LENGTH);

? Who cooked it?

Pierre-Henry Soria

[![@phenrysay][twitter-image]](https://twitter.com/phenrysay) [![pH-7][github-image]](https://github.com/pH-7)

Pierre-Henry Soria, a highly passionate, zen &amp; pragmatic software engineer ?

?? ?Would like to help? Offer me a coffee and boost the software development at the same time! ?

?? License

PHP Passcode/Password Generator is generously distributed under the MIT ?

<!-- GitHub's Markdown reference links --> [twitter-image]: https://img.shields.io/badge/Twitter-1DA1F2?style=for-the-badge&logo=twitter&logoColor=white [github-image]: https://img.shields.io/badge/GitHub-100000?style=for-the-badge&logo=github&logoColor=white


  Files folder image Files  
File Role Description
Files folder image.github (1 directory)
Files folder imagemedia (1 file)
Files folder imagesrc (1 directory)
Files folder imagetests (1 directory)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE.md Lic. License text
Accessible without login Plain text file phpunit.xml.dist Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation
Accessible without login Plain text file save-code.sh Data Auxiliary data

  Files folder image Files  /  .github  
File Role Description
Files folder imageworkflows (1 file)

  Files folder image Files  /  .github  /  workflows  
File Role Description
  Accessible without login Plain text file test-ci.yml Data Auxiliary data

  Files folder image Files  /  media  
File Role Description
  Accessible without login Image file kofi-logo.png Icon Icon image

  Files folder image Files  /  src  
File Role Description
Files folder imageGenerator (2 files)

  Files folder image Files  /  src  /  Generator  
File Role Description
  Plain text file Passcode.php Class Class source
  Plain text file Password.php Class Class source

  Files folder image Files  /  tests  
File Role Description
Files folder imageUnit (1 directory)

  Files folder image Files  /  tests  /  Unit  
File Role Description
Files folder imageGenerator (2 files)

  Files folder image Files  /  tests  /  Unit  /  Generator  
File Role Description
  Plain text file PasscodeTest.php Class Class source
  Plain text file PasswordTest.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:60
This week:0
All time:10,460
This week:673Up