PHPackages                             degraciamathieu/riddler - 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. degraciamathieu/riddler

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

degraciamathieu/riddler
=======================

Password generator service

v1.3.2(7y ago)135.1k4[1 issues](https://github.com/DeGraciaMathieu/Riddler/issues)MITPHPPHP &gt;=5.4.0CI failing

Since Jan 14Pushed 5y ago1 watchersCompare

[ Source](https://github.com/DeGraciaMathieu/Riddler)[ Packagist](https://packagist.org/packages/degraciamathieu/riddler)[ Docs](https://github.com/degraciamathieu/riddler)[ RSS](/packages/degraciamathieu-riddler/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (8)Dependencies (2)Versions (9)Used By (0)

[![](https://camo.githubusercontent.com/5aabe74f2e7dc288c9c2adedef951d6978feda59da9624337ca4ce9612345f16/68747470733a2f2f6936322e73657276696d672e636f6d2f752f6636322f31312f31332f36312f33322f726964646c6531302e706e67)](https://camo.githubusercontent.com/5aabe74f2e7dc288c9c2adedef951d6978feda59da9624337ca4ce9612345f16/68747470733a2f2f6936322e73657276696d672e636f6d2f752f6636322f31312f31332f36312f33322f726964646c6531302e706e67)

[![Codacy Badge](https://camo.githubusercontent.com/b75ec0e47d7b2c8da48b12aee6f9c8a1fa890f40761d63df93d5084f6c7eed88/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f6436363261346661353236613461373039643361643139393163626132353333)](https://www.codacy.com/app/DeGraciaMathieu/Riddler?utm_source=github.com&utm_medium=referral&utm_content=DeGraciaMathieu/Riddler&utm_campaign=Badge_Grade)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/e2c99070ffa621b0a2065254bc52618d1f4442d43a05d361de6036010b93c942/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f44654772616369614d6174686965752f526964646c65722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/degraciamathieu/riddler/?branch=master)[![Build Status](https://camo.githubusercontent.com/9881fc1322180c6b4d037d4f807f0db346ab389fb529b55f572c7457a74cb2ce/68747470733a2f2f7472617669732d63692e6f72672f44654772616369614d6174686965752f526964646c65722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/DeGraciaMathieu/Riddler)[![Code Coverage](https://camo.githubusercontent.com/bb2c2a87e491eef815e1d9f4fe75351d8ee1c192130fb572893f20259979867e/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f44654772616369614d6174686965752f526964646c65722f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/DeGraciaMathieu/Riddler/?branch=master)[![Latest Version on Packagist](https://camo.githubusercontent.com/da2b8046f646bb3b6cd8dd1eb355adde0995cac576d98d5596e44654f95bf21c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f64656772616369616d6174686965752f726964646c65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/degraciamathieu/riddler)[![](https://camo.githubusercontent.com/e6c573a1893fd865553b05006cbefb8e45b1d8b2662b14013bdfbddb2383c662/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f64656772616369616d6174686965752f726964646c65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/degraciamathieu/riddler)

DeGraciaMathieu/Riddler
=======================

[](#degraciamathieuriddler)

Password generator service

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

[](#installation)

Run in console below command to download package to your project:

```
composer require degraciamathieu/riddler

```

Password generation usage
-------------------------

[](#password-generation-usage)

A password is a set of one or more criteria composed of a dictionary and an occurrence.

The available dictionaries are :

- AccentedLetter
- AccentedUppercaseLetter
- Digit
- Letter
- SpecialCharacter
- UppercaseLetter

Available occurrences :

- Strict
- Between
- None

```
require 'vendor\autoload.php';

use DeGraciaMathieu\Riddler\Password;
use DeGraciaMathieu\Riddler\Dictionaries;
use DeGraciaMathieu\Riddler\Occurrences;

$password = new Password();
$password->addCriteria(new Dictionaries\Digit(), new Occurrences\Strict(5));
$password->addCriteria(new Dictionaries\Letter(), new Occurrences\Between(3, 6));
$password->generate();
```

To build passwords faster, it is possible to use a set of prescinded criteria using the formats.

Available formats :

- LongDigit
- MixedComplex
- MixedStrong
- SmallAlphanumeric
- StrongAlphanumeric

```
require 'vendor\autoload.php';

use DeGraciaMathieu\Riddler\Password;
use DeGraciaMathieu\Riddler\Formats;

$password = new Password();
$password->addFormat(new Formats\StrongAlphanumeric());
$password->generate();
```

It is possible to create its own class format implementing the interface DeGraciaMathieu\\Riddler\\Contracts\\Format

Check password score
--------------------

[](#check-password-score)

It's also possible to check if a passwords matches the required list of criteria with the Score method.

```
$password = new Password;
$password->addCriteria(new Digit(), new Strict(3));
$password->addCriteria(new Letter(), new Between(3, 5));
$password->score('123abcd'); // 100

$password = new Password;
$password->addCriteria(new Digit(), new Strict(3));
$password->addCriteria(new Letter(), new Between(3, 5));
$password->score('123a'); // 50
```

The value of the score method being the percentage of validated criteria.

Check password passed
---------------------

[](#check-password-passed)

```
$password = new Password;
$password->addCriteria(new Digit(), new Strict(3));
$password->addCriteria(new Letter(), new Between(3, 5));
$password->passed('123a');

// [
//     ['name' => 'digit_strict_3', 'passed' => true],
//     ['name' => 'letter_between_3_5', 'passed' => false],
// ]
```

```
$password = new Password;
$password->addNamedCriteria('MyName', new Digit(), new Strict(3));
$password->passed('123');

// [
//     ['name' => 'MyName', 'passed' => true],
// ]
```

Examples
--------

[](#examples)

### Classics

[](#classics)

```
$password = new Password;
$password->addCriteria(new Digit(), new Strict(10));
$password->generate(); // "4731412968"

$password = new Password;
$password->addCriteria(new Letter(), new Strict(20));
$password->generate(); // "tugmdzkgohnnkfrxuqns"

$password = new Password;
$password->addCriteria(new UppercaseLetter(), new Strict(20));
$password->generate(); // "JDXIRCEBWDPZLCWIJNYZ"

$password = new Password;
$password->addCriteria(new UppercaseLetter(), new Between(5, 7));
$password->addCriteria(new Letter(), new Between(5, 7));
$password->generate(); // "xIXPstuqTZmb"

$password = new Password;
$password->addCriteria(new SpecialCharacter(), new Strict(15));
$password->generate(); // "#^_=%§][:@_]^%="

$password = new Password;
$password->addCriteria(new AccentedLetter(), new Strict(15));
$password->generate(); // "üãöîâüîüûàóäùéú"

$password = new Password;
$password->addCriteria(new AccentedUppercaseLetter(), new Strict(15));
$password->generate(); // "ÂÚÏÝÒÌÀÂÜÝÛËÍÊÌ"

$password = new Password;
$password->addCriteria(new Digit(), new Strict(5));
$password->addCriteria(new Letter(), new Strict(5));
$password->addCriteria(new SpecialCharacter(), new Between(5, 10));
$password->generate(); // "!186u;n&~§3r7hb|~?"

$password = new Password;
$password->addCriteria(new Digit(), new Between(5, 7));
$password->addCriteria(new Letter(), new Between(5, 7));
$password->addCriteria(new UppercaseLetter(), new Between(5, 7));
$password->addCriteria(new AccentedLetter(), new Between(5, 7));
$password->addCriteria(new SpecialCharacter(), new Between(5, 7));
$password->generate(); // "uELòp§iO°L§7b~â]3ûë7èm96A"
```

### Formats

[](#formats)

```
$password = new Password();
$password->addFormat(new Formats\LongDigit());
$password->generate(); // "075197457894437657185665450123"

$password = new Password();
$password->addFormat(new Formats\SmallAlphanumeric());
$password->generate(); // "mA5M6ap167gRTeE"

$password = new Password();
$password->addFormat(new Formats\StrongAlphanumeric());
$password->generate(); // "492OHwdJEdDT5Lb89zhY9c26j4XhmX"

$password = new Password();
$password->addFormat(new Formats\MixedStrong());
$password->generate(); // "41súdSXWHV65k2G0lr0õèñzåY"

$password = new Password();
$password->addFormat(new Formats\MixedComplex());
$password->generate(); // "Äûc[%ÀÁkWï_1V8k3uw*3§ÔEaAÍ+5§ôåûWYI6äÕ7"
```

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 91.6% 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 ~71 days

Recently: every ~112 days

Total

8

Last Release

2590d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/11473997?v=4)[DeGraciaMathieu](/maintainers/DeGraciaMathieu)[@DeGraciaMathieu](https://github.com/DeGraciaMathieu)

---

Top Contributors

[![DeGraciaMathieu](https://avatars.githubusercontent.com/u/11473997?v=4)](https://github.com/DeGraciaMathieu "DeGraciaMathieu (76 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (3 commits)")[![william-suppo](https://avatars.githubusercontent.com/u/6459452?v=4)](https://github.com/william-suppo "william-suppo (3 commits)")[![Wall-E-psr](https://avatars.githubusercontent.com/u/39435122?v=4)](https://github.com/Wall-E-psr "Wall-E-psr (1 commits)")

---

Tags

laravellaravel-5-packagepasswordpassword-generatorlaravelpasswordgenerator

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/degraciamathieu-riddler/health.svg)

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

###  Alternatives

[tomatophp/filament-helpers

Helper Class Generator to manage your forms and table inside your filament app

128.0k](/packages/tomatophp-filament-helpers)

PHPackages © 2026

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