PHP code example of delight-im / ids

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

    

delight-im / ids example snippets


     

$generator = new \Delight\Ids\Id();

$generator->encode(6); // => "43Vht7"
$generator->decode('43Vht7'); // => 6

$generator->shorten(3141592); // => "vJST"
$generator->unshorten("vJST"); // => 3141592

$generator->obfuscate(42); // => 958870139
$generator->deobfuscate(958870139); // => 42