pharaonic / php-fingerprint
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
Requires
- php: >=8.0 <8.1
- ext-mbstring: *
Requires (Dev)
- laravel/pint: ^1.5
- pestphp/pest: ^1.23
- phpstan/phpstan: ^2.1
Suggests
- ext-intl: Required only for unicode() rules, unless symfony/polyfill-intl-normalizer is installed.
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-10-12 18:45:11 UTC
README
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.
