PHPackages                             ensnared/pwgen - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. ensnared/pwgen

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ensnared/pwgen
==============

Generate pronounceable random password

1.0.1(4y ago)05MITPHPPHP &gt;=7.4

Since Jun 30Pushed 2y ago1 watchersCompare

[ Source](https://github.com/ensnared/pwgen)[ Packagist](https://packagist.org/packages/ensnared/pwgen)[ Docs](https://github.com/ensnared/pwgen)[ RSS](/packages/ensnared-pwgen/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependenciesVersions (3)Used By (0)

Very Simple PHP Pronounceable Password Generator
================================================

[](#very-simple-php-pronounceable-password-generator)

Description
-----------

[](#description)

This is a very simple class for creating random pronounceable passwords. By default it also uses special characters and numbers, but this can be disabled. One can also customize the letter combinations that are allowed, as well as character replacements.

**Note:** This class is not based on, nor does it have anything to do with, other similar projects with the same name.

Requirements
------------

[](#requirements)

- PHP 7.4 or newer
- mbstring extension

Installation
------------

[](#installation)

Install with composer:

```
composer require ensnared/pwgen
```

Usage
-----

[](#usage)

To create a password with default settings, simply use `Password::create();`.

By default, the passwords generated will be between 8 and 12 characters long, and will include at least 2 special characters and 2 digits.

Configuration
-------------

[](#configuration)

The behaviour can be configured with the methods below. All these methods also have an equivalent get-method.

- `Password::setConsonants()`
    - Set list of consonants used in password creation.
    - Default is all consonants in the english alphabet.
- `Password::setDigits()`
    - Set number of digits to add to end of password.
    - Default is 2.
- `Password::setDoubleConsonantsAfterVowel()`
    - Set the list of double consonants that will only be used after a vowel in a password.
- `Password::setDoubleConsonantsAnywhere()`
    - Set the list of double consonants that can be used anywhere in a password.
- `Password::setDoubleConsonantsFirst()`
    - Set the list of double consonants that will only be used in the beginning of a password.
- `Password::setDoubleVowelsAfterConsonant()`
    - Set the list of double vowels that will only be used after a consonant in a password.
- `Password::setDoubleVowelsAnywhere()`
    - Set the list of double vowels that can be used anywhere in a password.
- `Password::setDoubleVowelsFirst()`
    - Set the list of double vowels that will only be used in the beginning of a password.
- `Password::setMaxLength()`
    - Set the maximum length of generated passwords.
    - Default is 12
    - Note that this is not a hard limit, in some cases a password might be 1-2 characters longer, depending on wether warping and special characters are in use.
- `Password::setMinLength()`
    - Set the minimum length of generated passwords.
    - Default is 8
    - Note that this is not a hard limit, in some cases a password might be 1-2 characters shorter, depending on wether warping and special characters are in use.
- `Password::setNumSpecialChars()`
    - Set number of special characters in a password.
    - Default is 1.
    - Set to 0 to disable.
    - If warping is used, warped characters that result in special characters will still be warped even if you set this to 0. If not 0, warped special characters will count towards this number.
- `Password::setRareCharacters()`
    - Set the list of rare characters that only has a percentage chance of being used.
    - Default is l, q, w, x, z
- `Password::setRareCharactersChance()`
    - Set the percentile chance of rare characters being used.
    - Default is 30.
    - Set to 0 to prevent rare characters from ever being used.
    - Set to 100 to disable the functionality.
- `Password::setSpecialChars()`
    - Set list of special characters used in password creation.
    - Default is !@#$%&amp;\*-+?
- `Password::setVowels()`
    - Set list of vowels used in password creation
    - Default is all vowels in the english alphabet.
- `Password::setWarpCharactersChance()`
    - Set the percentile chance of characters being replaced as defined by `getWarpCharactersMap()`.
    - Default is 75.
    - Set to 0 to disable warping.
    - Set to 100 to always warp.
- `Password::setWarpCharactersMap()`
    - Set the map of characters to be warped (replaced).

LICENSE
-------

[](#license)

MIT

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

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 ~0 days

Total

2

Last Release

1781d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0b9006b55717ad1bd893769be737936ebc5f79a5585eb42f69d8e1977cde4067?d=identicon)[ensnared](/maintainers/ensnared)

---

Top Contributors

[![NorseJedi](https://avatars.githubusercontent.com/u/477382?v=4)](https://github.com/NorseJedi "NorseJedi (15 commits)")

### Embed Badge

![Health badge](/badges/ensnared-pwgen/health.svg)

```
[![Health](https://phpackages.com/badges/ensnared-pwgen/health.svg)](https://phpackages.com/packages/ensnared-pwgen)
```

PHPackages © 2026

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