PHPackages                             mcardle/password-generator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. mcardle/password-generator

ActiveLibrary[Security](/categories/security)

mcardle/password-generator
==========================

An easy-to-use password generator for your project

8.2.x-dev(2y ago)01[1 PRs](https://github.com/mcardle/password-generator/pulls)MITPHPPHP ^8.2CI passing

Since Sep 25Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/mcardle/password-generator)[ Packagist](https://packagist.org/packages/mcardle/password-generator)[ RSS](/packages/mcardle-password-generator/feed)WikiDiscussions 8.2 Synced 1mo ago

READMEChangelogDependencies (1)Versions (5)Used By (0)

[![CI Workflow](https://github.com/mcardle/password-generator/actions/workflows/ci.yml/badge.svg)](https://github.com/mcardle/password-generator/actions/workflows/ci.yml)[![codecov](https://camo.githubusercontent.com/35053582e4b5b53ca8c06db630f17856cf6a8d8f803b4d7966511e64dd5831f8/68747470733a2f2f636f6465636f762e696f2f67682f6d636172646c652f70617373776f72642d67656e657261746f722f6272616e63682f382e322f67726170682f62616467652e7376673f746f6b656e3d524e4f30504f32374743)](https://codecov.io/gh/mcardle/password-generator)

Password Generator
==================

[](#password-generator)

This is just a simple PHP password generator. To generate a strong password simple, just type:

```
echo \McArdle\PasswordGenerator::all(8);

```

The number eight is the length of the password. If you want to specify how many of each chars must be in the string, you can instantiate each generator by itself like this:

```
$numbers = new \McArdle\Generators\NumberGenerator(5);
$lower = new \McArdle\Generators\LowerCaseGenerator(7);
$upper = new \McArdle\Generators\UpperCaseGenerator(9);
$special = new \McArdle\Generators\SpecialCharGenerator(2);

$generators = [$numbers, $lower, $upper, $special];

$passwordGenerator = new \McArdle\PasswordGenerator($generators);
echo $passwordGenerator->generate();

```

You can of course pass just one or whatever the number of generators you like. You can also create your own, just implement the interface below:

```
\McArdle\Generators\GeneratorInterface

```

Since version 8.2, it is also possible to create a password fluently, like this:

```
$password = \McArdle\PasswordGenerator::init()
    ->special(4)   // The amount of special characters
    ->number(2)    // The amount of numbers
    ->uppercase(6) // The amount of uppercase letters
    ->lowercase(3) // The amount of lowercase letters
    ->generate(8); // The length of the password

```

###  Health Score

32

—

LowBetter than 71% of packages

Maintenance57

Moderate activity, may be stable

Popularity1

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~339 days

Total

4

Last Release

1034d ago

Major Versions

7.4.x-dev → 8.2.x-dev2023-07-10

PHP version history (4 changes)7.2.x-devPHP ^7.2

7.3.x-devPHP ^7.3

7.4.x-devPHP ^7.4

8.2.x-devPHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/e880510d50907f28dc56d0d80f964a2f70c8662c4e60341a915fd8e73f07cffd?d=identicon)[mcardle](/maintainers/mcardle)

---

Top Contributors

[![mcardle](https://avatars.githubusercontent.com/u/4198807?v=4)](https://github.com/mcardle "mcardle (48 commits)")

---

Tags

securitypasswordgenerator

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mcardle-password-generator/health.svg)

```
[![Health](https://phpackages.com/badges/mcardle-password-generator/health.svg)](https://phpackages.com/packages/mcardle-password-generator)
```

###  Alternatives

[rych/phpass

PHP Password Library: Easy, secure password management for PHP

248801.7k4](/packages/rych-phpass)[bordoni/phpass

Portable PHP password hashing framework

244.4M26](/packages/bordoni-phpass)[jeremykendall/password-validator

Password Validator validates password\_hash generated passwords, rehashes passwords as necessary, and will upgrade legacy passwords.

14469.9k3](/packages/jeremykendall-password-validator)[ph-7/passcode-password-generator

A simple way to generate random cryptographically secure passcodes and passwords

1223.4k2](/packages/ph-7-passcode-password-generator)[nicobleiler/php-passphrase

Passphrase generator with Laravel integration, inspired by Bitwarden. Uses the EFF long word list by default with support for custom wordlists.

451.7k](/packages/nicobleiler-php-passphrase)[mxrxdxn/pwned-passwords

A library to query Troy Hunt's Pwned Passwords service to see whether or not a password has been included in a public breach.

3270.9k2](/packages/mxrxdxn-pwned-passwords)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
