PHPackages                             carry0987/hash - 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. carry0987/hash

ActiveLibrary[Security](/categories/security)

carry0987/hash
==============

PHP-Hash is a comprehensive library designed to facilitate the generation of securely encrypted URLs.

1.1.0(2y ago)0452MITPHPPHP &gt;=7.4

Since Mar 19Pushed 2y ago1 watchersCompare

[ Source](https://github.com/carry0987/PHP-Hash)[ Packagist](https://packagist.org/packages/carry0987/hash)[ RSS](/packages/carry0987-hash/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (4)DependenciesVersions (5)Used By (2)

PHP-Hash
========

[](#php-hash)

[![Packgist](https://camo.githubusercontent.com/a445ca31dc59cd83cced809b5108f30e18392a1c7086ded4c9eca77ed7028b79/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6361727279303938372f686173682e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/carry0987/hash)
PHP-Hash is a comprehensive library designed to facilitate the generation of securely encrypted URLs. With support for customizable encryption algorithms and AEAD (Authenticated Encryption with Additional Data) cipher modes, it offers flexibility while ensuring the integrity and authenticity of the data.

Features
--------

[](#features)

- Easy generation of encrypted URLs.
- Support for a variety of encryption algorithms and AEAD cipher modes.
- Customizable prefixes, suffixes, and path formatting for encrypted URLs.
- Integration with the Composer package manager for straightforward installation.

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

[](#installation)

Use Composer to install PHP-Hash in your project:

```
composer require carry0987/hash
```

Usage
-----

[](#usage)

To use PHP-Hash to generate encrypted URLs, follow these steps:

1. **Initialization**:

```
use carry0987\Hash\Hash;

// Initialize with your signature key and signature salt
$hash = new Hash('your_hex_signature_key', 'your_hex_signature_salt');
```

2. **Configuration** (Optional): Customize encryption settings as needed.

```
// Set a custom encryption cipher
$hash->setCipher('aes-256-gcm');

// Set a custom encryption algorithm for generating binary signatures
$hash->setEncryptAlgorithm('sha256');

// Optionally, set a custom Additional Authenticated Data (AAD) for AEAD ciphers
$hash->setAAD('your_custom_aad');

// Customize the encrypted path's prefix and suffix
$hash->setPrefix('/custom-prefix');
$hash->setSuffix('/custom-suffix');
```

3. **Generate Encrypted URL**:

```
$originalUrl = 'https://yourdomain.com/original/path';
$encryptedUrl = $hash->generateEncryptedUrl($originalUrl);
echo $encryptedUrl;
```

Custom Path Formatting
----------------------

[](#custom-path-formatting)

PHP-Hash allows for custom formatting of the encrypted path through a user-defined callback function:

```
$hash->setPathFormatter(function ($encryptedUrl, $options) {
    // Your custom logic here
    return "/custom/format/$encryptedUrl";
});
```

License
-------

[](#license)

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

###  Health Score

23

—

LowBetter than 25% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 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

880d ago

### Community

Maintainers

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

---

Top Contributors

[![carry0987](https://avatars.githubusercontent.com/u/12984973?v=4)](https://github.com/carry0987 "carry0987 (12 commits)")

---

Tags

hashphp

### Embed Badge

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

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

###  Alternatives

[phpids/phpids

PHPIDS (PHP-Intrusion Detection System) is a simple to use, well structured, fast and state-of-the-art security layer for your PHP based web application

791150.0k2](/packages/phpids-phpids)[paragonie/ecc

PHP Elliptic Curve Cryptography library

25866.3k44](/packages/paragonie-ecc)[nicobleiler/php-passphrase

Passphrase generator with Laravel integration, inspired by Bitwarden. Uses the EFF long word list by default with support for custom wordlists.

4912.6k](/packages/nicobleiler-php-passphrase)[dwgebler/encryption

Encryption wrapper for PHP using libsodium — simple API for symmetric and asymmetric encryption, password hashing, digital signing, and message authentication.

317.5k](/packages/dwgebler-encryption)

PHPackages © 2026

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