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.5.0
2026-10-13 11:03 UTC
Requires
- php: >=8.5 <8.6
- ext-mbstring: *
Requires (Dev)
- laravel/pint: ^1.20
- pestphp/pest: ^4.0
- phpstan/phpstan: ^2.1.33
Suggests
- ext-intl: Required only for unicode() rules, unless symfony/polyfill-intl-normalizer is installed.
Provides
None
Conflicts
None
Replaces
None
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: PHP Fingerprint Documentation.
Support & Security
See SUPPORT.md and SECURITY.md.
License
MIT. See LICENSE.
