Search by

pharaonic / php-fingerprint

Pharaonic

Deterministic fingerprints and ordered signatures for PHP data: canonical map ordering, configurable list semantics, path-aware normalization, hashing, HMAC and protocol-safe field signing.

8.0.1 2026-10-12 18:42 UTC

This package is auto-updated.

Last update: 2026-10-12 18:45:11 UTC


README

PHP Version : 8.0 License Tests
Source Packagist Version Packagist Downloads

Deterministic fingerprints for PHP data.

The same data gives the same fingerprint, whatever the key order, the machine, the locale or the PHP version.

Installation

composer require pharaonic/php-fingerprint

Usage

use Pharaonic\Fingerprint\Fingerprint;

Fingerprint::make(['id' => 7, 'tags' => ['php', 'laravel']]);
// Same result for ['tags' => ['php', 'laravel'], 'id' => 7]: key order never matters.
// Different result for ['id' => '7', ...] or a reordered list: types and list order do.

Fingerprint::for($order)
    ->ignore('updated_at')
    ->at('customer.email')->trim()->lower()
    ->hmac($secret)
    ->make();

For protocols that sign fields in a fixed order, such as payment gateway callbacks, Fingerprint::signature($payload)->fields([...]) builds and verifies the exact ordered message instead.

Documentation

Full documentation: https://pharaonic.dev/packages/php/fingerprint

Support & Security

See SUPPORT.md and SECURITY.md.

License

MIT. See LICENSE.