badarnadeem / random-password

Generate random passwords of different types and lengths. Set custom lengths and strengths for your passwords. Easy to install and use.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Generate Random Passwords

Generate random passwords of different types and lengths

Installation

Install the package using the following composer command

composer require badarnadeem/random-password

Usage

Using the Password class to generate random passwords


    <?php

        use BadarNadeem\RandomPassword\Password;

        $password = new Password();

        print_r($password->generate());

    ?>

Set Password Length and Strength

Pass in custom length and strength for your passwords. The default password length is set to 8 and default strength is set to strong.


    <?php

        use BadarNadeem\RandomPassword\Password;
        use BadarNadeem\RandomPassword\PasswordStrength;

        $password = new Password([
            'length' => 12,
            'strength' => PasswordStrength::STRONG
        ]);

    ?>


Password Strength Options

The following 3 options are available for password strength


    <?php

        use BadarNadeem\RandomPassword\PasswordStrength;

        PasswordStrength::STRONG;
        PasswordStrength::MEDIUM;
        PasswordStrength::WEAK;

    ?>


About

Generate random passwords of different types and lengths. Set custom lengths and strengths for your passwords. Easy to install and use.

License:GNU General Public License v3.0


Languages

Language:PHP 100.0%