PHP code example of hereismhtm / pin-puzzle

1. Go to this page and download the library: Download hereismhtm/pin-puzzle 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/ */

    

hereismhtm / pin-puzzle example snippets


use PinPuzzle\PinPuzzle;

$pin = '1234';

$pzl = new PinPuzzle(uuid: '365e898f-e2a3-4be0-bae8-f25bb241c51d'); // use your own uuid
$inst = $pzl->resolve($pin);

echo $inst . "\n";
# OUTPUT: 4497446061834.6175011677438780992.heBStfl9FLfqaqbC
# NOTE: output is unique every run time.


// ----------------


$my_pin = $pzl->assembly($inst);

if ($my_pin === false)
    echo 'Bad PIN instruction setup' . "\n";
else
    echo $my_pin . "\n";
    # OUTPUT: 1234


$inst = (new \PinPuzzle\PinInstruction())
    ->processor('4497446061834')
    ->input('6175011677438780992')
    ->key('heBStfl9FLfqaqbC');