PHPackages                             dpc/hash-verifier - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. dpc/hash-verifier

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

dpc/hash-verifier
=================

Package for Nonce Generation &amp; HMac Validation for authentication with APIs

v0.2.0(8y ago)4503MITPHP

Since Sep 23Pushed 8y ago1 watchersCompare

[ Source](https://github.com/Dylan-DPC/hash-verifier)[ Packagist](https://packagist.org/packages/dpc/hash-verifier)[ RSS](/packages/dpc-hash-verifier/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (4)Dependencies (1)Versions (5)Used By (0)

hash-verifier
=============

[](#hash-verifier)

hash verification using a nonce &amp; verifying the hmac from the URL for a laravel application

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

[](#installation)

```
composer require dpc/hash-verifier
```

The service provider will be automatically discovered in Laravel 5.5. Publish the config file by running:

```
php artisan vendor:publish --provider="Dpc\HashVerifier\AuthValidatorServiceProvider"
```

This will create a `validator.php` in your config folder.

> Do not use your secret directly in config file. Instead fetch it from the `.env` or server environment variables.

Usage
-----

[](#usage)

Inject the nonce generator contract and/or HMAC validator contract in your class:

```
  public function __construct(NonceContract $generator)
    {
        $this->generator = $generator;
    }
```

To generate a nonce:

```
$nonce = $this->generator->generateNonce($user)
```

The nonce will be automatically stored in the session with key as `nonce'. To retrieve it call:

```
$nonce = $this->generator->getStoredNonce();
```

Ensure that you do not mutate the nonce.

To verify whether the nonce matches

```
$nonceMatches = $this->generator->matches($user, $nonce);
```

To validate if the hmac matches the components of the URL:

```
$result = $this->validator->validate($uriComponents));
```

You can check this [repo](https://github.com/themeanorak/laravel-shopify/blob/master/src/Modules/Auth.php) for further details on how to use this package

### Versioning

[](#versioning)

This package follows [semver](http://semver.org/). Features introduced &amp; any breaking changes created in major releases are mentioned in [releases](https://github.com/Dylan-DPC/hash-verifier/releases).

Contributing
------------

[](#contributing)

1. Fork it!
2. Create your feature branch: `git checkout -b my-new-feature`
3. Commit your changes: `git commit -am 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request :D

Author
------

[](#author)

[Dylan DPC](https://github.com/Dylan-DPC)

Versioning
----------

[](#versioning-1)

This package follows semver. Features introduced &amp; any breaking changes created in major releases are mentioned in releases.

Support
-------

[](#support)

If you need help or have any questions you can:

- Create an issue here
- Send a tweet to @DPC\_22
- Email me at
- DM me on the [larachat](https://larachat.co) slack team (@Dylan DPC)

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 95.2% 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 ~13 days

Total

4

Last Release

3155d ago

### Community

Maintainers

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

---

Top Contributors

[![Dylan-DPC](https://avatars.githubusercontent.com/u/99973273?v=4)](https://github.com/Dylan-DPC "Dylan-DPC (20 commits)")[![Jelmergu](https://avatars.githubusercontent.com/u/18192158?v=4)](https://github.com/Jelmergu "Jelmergu (1 commits)")

---

Tags

hashhmaclaravelnoncephp

### Embed Badge

![Health badge](/badges/dpc-hash-verifier/health.svg)

```
[![Health](https://phpackages.com/badges/dpc-hash-verifier/health.svg)](https://phpackages.com/packages/dpc-hash-verifier)
```

###  Alternatives

[paragonie/halite

High-level cryptography interface powered by libsodium

1.2k10.2M76](/packages/paragonie-halite)[better-futures-studio/filament-local-logins

This is my package filament-local-logins

1334.6k](/packages/better-futures-studio-filament-local-logins)

PHPackages © 2026

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