PHP Classes

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

Recommend this page to a friend!

  Author Author  
Picture of Pierre-Henry Soria
Name: Pierre-Henry Soria <contact>
Classes: 40 packages by
Country: United Kingdom
Age: 32
All time rank: 39717 in United Kingdom
Week rank: 14 Up1 in United Kingdom Up
Innovation award
Innovation award
Nominee: 15x

Winner: 3x


  Detailed description   Download Download .zip .tar.gz  
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.

Details

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


  Classes of Pierre-Henry Soria  >  PHP Passcode and Password Generator  >  Download Download .zip .tar.gz  >  Support forum Support forum  >  Blog Blog  >  RSS 1.0 feed RSS 2.0 feed Latest changes  
Name: PHP Passcode and Password Generator
Base name: passcode-password-ge
Description: Generate password strings that follow rules
Version: -
PHP version: 5
License: GNU General Public License (GPL)
All time users: 55 users
All time rank: 10342
Week users: 0 users
Week rank: 171 Equal
 
  Groups   Rate classes User ratings   Applications   Files Files  

  Groups  
Group folder image PHP 5 Classes using PHP 5 specific features View top rated classes
Group folder image Text processing Manipulating and validating text data View top rated classes
Group folder image Security Security protection and attack detection View top rated classes


  User ratings  
Not yet rated by the users

  Applications that use this package  
No pages of applications that use this class were specified.

Add link image If you know an application of this package, send a message to the author to add a link here.

  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

Download Download all files: passcode-password-ge.tar.gz passcode-password-ge.zip
NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.
  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

Download Download all files: passcode-password-ge.tar.gz passcode-password-ge.zip
NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.