PHP code example of alex-kassel / stable-fingerprint

1. Go to this page and download the library: Download alex-kassel/stable-fingerprint library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

alex-kassel / stable-fingerprint example snippets


use AlexKassel\StableFingerprint\StableFingerprint;

$fingerprint = new StableFingerprint();

$payload = [
    'price' => 19.90,
    'available' => true,
    'variants' => [
        ['size' => 'M', 'stock' => 4],
        ['size' => 'L', 'stock' => 2],
    ],
];

$hex = $fingerprint->hash($payload);      // 64 lowercase hexadecimal characters
$binary = $fingerprint->binary($payload); // 32 raw bytes

assert($hex === bin2hex($binary));

use AlexKassel\StableFingerprint\StableFingerprint;

$hex = StableFingerprint::compute(['vendor' => 'audi', 'model' => 'q4']);