PHPackages                             rhurling/nonces - 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. rhurling/nonces

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

rhurling/nonces
===============

Allows the easy use of WordPress-like Nonces in an object-oriented way

3.0.0(10y ago)07711GPLv2PHP

Since Mar 25Pushed 10y ago1 watchersCompare

[ Source](https://github.com/rhurling/nonces)[ Packagist](https://packagist.org/packages/rhurling/nonces)[ RSS](/packages/rhurling-nonces/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (2)Versions (5)Used By (1)

Object Oriented Nonces
======================

[](#object-oriented-nonces)

Composer package that replicates WordPress nonces in an object oriented way.

[![Build Status](https://camo.githubusercontent.com/1377b9a73a0b279c4bc4ba4758e5fa49b66bac2747b10f7d1550e820b9fb9d99/68747470733a2f2f7472617669732d63692e6f72672f726875726c696e672f6e6f6e6365732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/rhurling/nonces)[![Coverage Status](https://camo.githubusercontent.com/815b12a4820998f4775c338e155183253bef3a4c1982ad681b488b5e4d95d864/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f726875726c696e672f6e6f6e6365732f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/rhurling/nonces?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/5058dbcf65fecd6103c5bec4565b24b31b29c586fee71150d343fbe8d460fa21/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f726875726c696e672f6e6f6e6365732f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/rhurling/nonces/?branch=master)

Usage
-----

[](#usage)

### Configure Nonce Defaults

[](#configure-nonce-defaults)

```
use RouvenHurling\Nonces\Config;

Config::setSalt($salt);
Config::setUserId($userId);
Config::setSessionToken($sessionToken);
```

### Create Nonce

[](#create-nonce)

```
use RouvenHurling\Nonces\Nonce;

$nonce = new Nonce('readme-action');
$nonce->generate();
```

### Verify Nonce

[](#verify-nonce)

```
use RouvenHurling\Nonces\Verifer;

$verifier = new Verifier();
$verifier->verify($nonce, $action);
```

### Override global configuration per Nonce

[](#override-global-configuration-per-nonce)

```
$nonce = new Nonce('Action', $myConfig);
$verifier = new Verifier($myConfig);

$nonce->setLifespan(172800);
$nonce->setAlgorithm('sha256');
$nonce->setSalt($salt);
$nonce->setUserId($userId);
$nonce->setSessionToken($sessionToken);
```

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity66

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

Total

4

Last Release

3746d ago

Major Versions

1.0.0 → 2.0.02016-03-26

2.1.0 → 3.0.02016-03-27

### Community

Maintainers

![](https://www.gravatar.com/avatar/d4ad9c7a1e850c35049355539ccc6f15cd338b931d3942050a65c3686a35a06b?d=identicon)[rhurling](/maintainers/rhurling)

---

Top Contributors

[![rhurling](https://avatars.githubusercontent.com/u/840655?v=4)](https://github.com/rhurling "rhurling (30 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/rhurling-nonces/health.svg)

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

PHPackages © 2026

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