badarnadeem/random-password

Generate random passwords of different types and lengths

Installs: 8

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/badarnadeem/random-password

v1.0.0 2023-11-13 23:36 UTC

This package is auto-updated.

Last update: 2025-12-14 04:26:32 UTC


README

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;

    ?>