PHP code example of dannyvilla / simtoken

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

    

dannyvilla / simtoken example snippets




$id = '100';
$encoded = SimToken::encode($id); // with salt and complexity 1
echo($encoded); // e8f8f8

$encoded = SimToken::encode($id, false, 2); // without salt and complexity 2
echo($encoded); // 188808880888

$encoded = SimToken::encode($id, true, 2); // with salt and complexity 2
echo($encoded); // b1h8b2h8b2h8

$encoded = SimToken::encode($id, false, 3); // without salt and complexity 3
echo($encoded); // 588888886888888868888888

$decoded = SimToken::decode($encoded, false, 3); // Decode the last encoded
echo($decoded); // 100