PHPackages                             pforret/digestif - 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. [Security](/categories/security)
4. /
5. pforret/digestif

ActiveLibrary[Security](/categories/security)

pforret/digestif
================

This is my package digestif

1.0.3(2y ago)111[3 PRs](https://github.com/pforret/digestif/pulls)MITPHPPHP ^8.1CI passing

Since Sep 14Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/pforret/digestif)[ Packagist](https://packagist.org/packages/pforret/digestif)[ Docs](https://github.com/pforret/digestif)[ GitHub Sponsors](https://github.com/pforret)[ RSS](/packages/pforret-digestif/feed)WikiDiscussions main Synced 1mo ago

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

Digestif helps you create unique unguessable URLs
=================================================

[](#digestif-helps-you-create-unique-unguessable-urls)

[![Latest Version on Packagist](https://camo.githubusercontent.com/f9444284043fbc1eb47916330cc5b96545308d9806287db6919a28713cc36d5b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f70666f727265742f64696765737469662e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/pforret/digestif)[![Tests](https://camo.githubusercontent.com/932965b51fdbae171d071b4c2d8e83ebed229c20bc57cb8982435579424e5791/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f70666f727265742f64696765737469662f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/pforret/digestif/actions/workflows/run-tests.yml)[![Total Downloads](https://camo.githubusercontent.com/d8ec939777450812ad1a1020895ef9ae8369c24f8e7370f908344fffee3a8ad0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f70666f727265742f64696765737469662e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/pforret/digestif)

[![](assets/unsplash.digestif.jpg)](assets/unsplash.digestif.jpg)

Package to create a digest of a string/array, to be used in creating unique unguessable URLs/folder names.

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

[](#installation)

You can install the package via composer:

```
composer require pforret/digestif
```

Usage
-----

[](#usage)

```
use Pforret\Digestif\Digestif;

$dig = new Digestif(env("DIGEST_SEED"));
// seed value should be unique for that server/application.
// It's important that it is not known to the outside world.
// It should be the same for the application creating the Digest as the one reading/verifying it

$url = "https://secure.example.com/invoice/1200323";
// if you make your URL like this, the URL for the other invoices can be guessed (e.g. 1200324, etc)

$digest = $dig->fromString($url);
$secure_url = "$url/$digest";
// URL = https://secure.example.com/invoice/1200323/0a1b-2c3d
// using a route /invoice/{id}/{digest} will allow you to verify the digest
// the URL of the next invoice 1200324 cannot be guessed without knowing the seed value

// or use this
$secure_url = "$url?$digest";
//URL = https://secure.example.com/invoice/1200323?0a1b-2c3d
// and then verify the digest before showing the actual invoice
if(!$dig->compareDigest($dig->fromString($url), $digest)){
    return false;
}
// 0a1b-2c3d will be ok, as 0a1b2c3d (without dash)
```

```

## Testing

```bash
composer test

```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

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

[](#contributing)

Please see [CONTRIBUTING](https://github.com/spatie/.github/blob/main/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Peter Forret](https://github.com/pforret)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance52

Moderate activity, may be stable

Popularity7

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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

977d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/474312?v=4)[Peter Forret](/maintainers/pforret)[@pforret](https://github.com/pforret)

---

Top Contributors

[![pforret](https://avatars.githubusercontent.com/u/474312?v=4)](https://github.com/pforret "pforret (21 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (17 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (11 commits)")

---

Tags

laravelphpsecuritypforretdigestif

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/pforret-digestif/health.svg)

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

###  Alternatives

[defuse/php-encryption

Secure PHP Encryption Library

3.9k162.4M214](/packages/defuse-php-encryption)[roave/security-advisories

Prevents installation of composer packages with known security vulnerabilities: no API, simply require it

2.9k97.3M6.4k](/packages/roave-security-advisories)[mews/purifier

Laravel 5/6/7/8/9/10 HtmlPurifier Package

2.0k16.7M113](/packages/mews-purifier)[robrichards/xmlseclibs

A PHP library for XML Security

41278.1M118](/packages/robrichards-xmlseclibs)[bjeavons/zxcvbn-php

Realistic password strength estimation PHP library based on Zxcvbn JS

86917.5M63](/packages/bjeavons-zxcvbn-php)[enlightn/security-checker

A PHP dependency vulnerabilities scanner based on the Security Advisories Database.

33732.2M110](/packages/enlightn-security-checker)

PHPackages © 2026

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