PHPackages                             jarne/password - 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. jarne/password

AbandonedArchivedLibrary

jarne/password
==============

A simple library to generate passwords

1.3.3(5y ago)1298↓100%MITPHPPHP &gt;=7.2

Since Jan 28Pushed 3y ago1 watchersCompare

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

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

password
========

[](#password)

A simple library to generate passwords

 [ ![Packagist version](https://camo.githubusercontent.com/78bde35924b1b7daf1bf648af02ec4fef1feec42ec459f5bd98b8b9e982fc0c1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a61726e652f70617373776f72642e737667) ](https://packagist.org/packages/jarne/password) [ ![PHP version](https://camo.githubusercontent.com/a420e9136d83029c4a54741ecd814a567b948da8d2daea74ecbc1a70d3fe4b53/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6a61726e652f70617373776f72642e737667) ](https://php.net) [ ![CircleCI](https://camo.githubusercontent.com/75817d6f744cb2a526faf3765d3758afb243b47c66300a0c38a637009c9e049a/68747470733a2f2f696d672e736869656c64732e696f2f636972636c6563692f70726f6a6563742f6769746875622f6a61726e652f70617373776f72642e737667) ](https://circleci.com/gh/jarne/password) [ ![License](https://camo.githubusercontent.com/20192cf39df2e9b83c613066178b8ce897a36a0f6b5f6b9148c8630164ad62b1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6a61726e652f70617373776f72642e737667) ](https://github.com/jarne/password/blob/master/LICENSE)

[• Install](#-install)
[• Usage](#-usage)
[• Examples](#%EF%B8%8F-examples)
[• Contribution](#-contribution)
[• License](#%EF%B8%8F-license)

📦 Install
---------

[](#-install)

This library requires PHP 7.2 or newer in order to work correctly. You can install it with:

```
$ composer require jarne/password

```

If you don't like Composer, you can also clone the repository with:

```
$ git clone https://github.com/jarne/password

```

👨‍💻 Usage
---------

[](#‍-usage)

There are two functions in this library:

- one to generate a random password
- and one to generate a random one which is easy to remember because it sounds like a real word

The arguments are the same for both functions:

```
/**
 * Generate a password
 *
 * @param int $length
 * @param int $lettersChance
 * @param int $numbersChance
 * @param int $specialCharactersChance
 * @return string
 */
public function generate(
    int $length = 8,
    int $lettersChance = 1,
    int $numbersChance = 1,
    int $specialCharactersChance = 1
): string
```

```
/**
 * Generate an easy to remember password
 *
 * @param int $length
 * @param int $lettersChance
 * @param int $numbersChance
 * @param int $specialCharactersChance
 * @return string
 */
public function generateEasyToRemember(
    int $length = 8,
    int $lettersChance = 1,
    int $numbersChance = 1,
    int $specialCharactersChance = 1
): string
```

See the examples section for a short code example how to use it.

⌨️ Examples
-----------

[](#️-examples)

Here are some examples how to use the functions.

Generate an 8-character long password:

```
$password = new Password();

$yourPassword = $password->generate();

echo "Your new password is " . $yourPassword;
```

If your password should only be 5 characters long, just change the second line to:

```
$yourPassword = $password->generate(5);
```

It's also possible to generate a password with more numbers than letters, for example:

```
$yourPassword = $password->generate(5, 1, 15, 1);
```

In the code above, the letter chance is set to 1, the numbers chance to 15, and the special characters chance to 1, so it's likely that the password contains more numbers than other characters.

🙋‍ Contribution
---------------

[](#‍-contribution)

Contributions are always very welcome! It's completely equal if you're a beginner or a more experienced developer.

Please read our **[Contribution Guidelines](CONTRIBUTING.md)** before creating an issue or submitting a pull request.

Thanks for your interest 🎉👍!

👨‍⚖️ License
------------

[](#‍️-license)

[MIT](https://github.com/jarne/password/blob/master/LICENSE)

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity65

Established project with proven stability

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

Recently: every ~262 days

Total

11

Last Release

2155d ago

PHP version history (3 changes)1.0.0PHP &gt;=7.0

1.2.2PHP &gt;=7.1

1.3.0PHP &gt;=7.2

### Community

Maintainers

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

---

Top Contributors

[![jarne](https://avatars.githubusercontent.com/u/15860314?v=4)](https://github.com/jarne "jarne (35 commits)")

---

Tags

charactersgeneratelibrarypasswordvowelspasswordlibrarygeneratecharactersvowels

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[filp/whoops

php error handling for cool kids

13.2k402.4M1.4k](/packages/filp-whoops)[mockery/mockery

Mockery is a simple yet flexible PHP mock object framework

10.7k497.0M23.5k](/packages/mockery-mockery)[nette/utils

🛠 Nette Utils: lightweight utilities for string &amp; array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.

2.1k394.3M1.5k](/packages/nette-utils)[ircmaxell/password-compat

A compatibility library for the proposed simplified password hashing algorithm: https://wiki.php.net/rfc/password\_hash

2.1k56.8M122](/packages/ircmaxell-password-compat)[symfony/password-hasher

Provides password hashing utilities

813137.2M90](/packages/symfony-password-hasher)[league/iso3166

ISO 3166-1 PHP Library

69536.3M116](/packages/league-iso3166)

PHPackages © 2026

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