PHPackages                             mhcgolds/harpia - 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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. mhcgolds/harpia

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

mhcgolds/harpia
===============

A simple password pattern checker

v1.0(1y ago)064MITPHP

Since Oct 3Pushed 1y ago1 watchersCompare

[ Source](https://github.com/mhcgolds/harpia)[ Packagist](https://packagist.org/packages/mhcgolds/harpia)[ RSS](/packages/mhcgolds-harpia/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Harpia is a simple password pattern check named after the biggest eagle that lives in south america, the Harpy eagle.

It comes with default patters to check if password has alphanumeric or special characters.

Usage:

```
$harpia = new \Mhcgolds\Harpia\Harpia();
$harpia
    ->addAlphaLowerCase() // Regex: [a-z]
    ->addAlphaUpperCase() // Regex: [A-Z]
    ->addNumeric() // Regex: [0-9]
    ->addSpecialChars(); // Regex: [@#!$&_\.]

$validPassword = '@Password123';
$invalidPassword = 'myPassword';

$harpia->check($validPassword);
var_dump($harpia->getResult()); // Prints 'bool(true)'

$harpia->check($invalidPassword);
var_dump($harpia->getResult()); // Prints 'bool(false)'
```

In the example above, Harpia was set to check if there is at least one alpha char in lowercase, on alpha char in lowercase, one numeric char and one special char. If any of those wasn't match, the result will be false. The complete regex used in example above will be `/([a-z]+)|([A-Z]+)|([0-9]+)|([@#!$&_\.]+)/` which is tested with `preg_match_all`.

It calculates the strength of the password by adding 1 point(by default) for each passed test. In the example above, a valid password would have strength of 4 points.

You can also add a custom regex segment with a custom strength point if you like:

```
$harpia = new \Mhcgolds\Harpia\Harpia();
$harpia
    ->addAlphaAll()
    ->addCustomPattern('\d', 2);
```

The complete regex used in example above will be `/([a-zA-Z+])|([\d+])/` being the custom regex of strength 2. A valid password would have strength of 3 points, 1 for `addAlphaAll` and 2 for the custom added.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance36

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

Top contributor holds 50% 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

Unknown

Total

1

Last Release

586d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4b93e6264c749b9949448302c14eafb3e578b7c68c4eb4acb8941324050a2454?d=identicon)[mhcgolds](/maintainers/mhcgolds)

---

Top Contributors

[![marcio-joinner](https://avatars.githubusercontent.com/u/77687598?v=4)](https://github.com/marcio-joinner "marcio-joinner (1 commits)")[![mhcgolds](https://avatars.githubusercontent.com/u/4540620?v=4)](https://github.com/mhcgolds "mhcgolds (1 commits)")

### Embed Badge

![Health badge](/badges/mhcgolds-harpia/health.svg)

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

###  Alternatives

[webmozart/assert

Assertions to validate method input/output with nice error messages.

7.6k894.0M1.2k](/packages/webmozart-assert)[bensampo/laravel-enum

Simple, extensible and powerful enumeration implementation for Laravel.

2.0k15.9M104](/packages/bensampo-laravel-enum)[swaggest/json-schema

High definition PHP structures with JSON-schema based validation

48612.5M73](/packages/swaggest-json-schema)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[ashallendesign/laravel-config-validator

A package for validating your Laravel app's config.

217905.3k5](/packages/ashallendesign-laravel-config-validator)[crazybooot/base64-validation

Laravel validators for base64 encoded files

1341.9M8](/packages/crazybooot-base64-validation)

PHPackages © 2026

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