Download the PHP package alex-kassel/stable-fingerprint without Composer
On this page you can find all versions of the php package alex-kassel/stable-fingerprint. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download alex-kassel/stable-fingerprint
More information about alex-kassel/stable-fingerprint
Files in alex-kassel/stable-fingerprint
Package stable-fingerprint
Short Description Deterministic SHA-256 canonicalization and payload hashing for PHP
License MIT
Homepage https://github.com/alex-kassel/stable-fingerprint
Informations about the package stable-fingerprint
🔑 Stable Fingerprint
Deterministic SHA-256 fingerprinting and recursive canonical payload hashing for PHP 8.2+
Installation • Basic Hashing • Key Features • Release Gate • Changelog
Stable Fingerprint generates small, deterministic SHA-256 fingerprints for pre-prepared PHP payloads.
It recursively sorts associative keys, preserves list order, canonicalizes finite float values, encodes compact JSON, and returns either a hexadecimal or raw binary SHA-256 digest. It deliberately avoids object normalization and business-specific data cleanup.
Key Features
- Deterministic Payload Hashing: Generates consistent 64-character hex (
hash()) or 32-byte binary (binary()) SHA-256 digests. - Recursive Key Sorting: Normalizes associative arrays with byte-wise
SORT_STRINGkey ordering regardless of initial key sequence. - List Order Preservation: Preserves exact sequence for sequential indexed lists (
0..n-1). - Finite Float Canonicalization: Accurately normalizes finite floats while rejecting non-finite values (
INF,NAN). - Strict Input Validation: Rejects objects, enums, resources, invalid UTF-8 byte sequences, and cyclic references via
InvalidPayloadException. - Static Convenience API: Quick hashing with
StableFingerprint::compute($payload).
Requirements
- PHP: 8.2+ (tested on 8.2, 8.3, 8.4, 8.5)
- Standard PHP Extensions:
ext-hash,ext-json
Installation
Install the package via Composer:
Usage
Basic Hashing
Static Convenience Helper
Testing
From the monorepo root, run the complete package verification pipeline:
Changelog
Please see CHANGELOG.md for more information on what has changed recently.
Security Vulnerabilities
Please review the security policy to report vulnerabilities.
License
The MIT License (MIT). Please see License File for more information.
All versions of stable-fingerprint with dependencies
ext-hash Version *
ext-json Version *