PHP code example of elliottlan / laravel-baser

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

    

elliottlan / laravel-baser example snippets


echo Baser::getTokenFromInt(436432278698); // 7GnTmBA

echo Baser::getIntFromToken('7GnTmBA'); // 436432278698

// calculate above the 32bit limit on old machines
echo Baser::bcMath()->getTokenFromInt(19598531548); // lolrly
echo Baser::bcMath()->getIntFromToken('lolrly'); // 19598531548

// set codeset to 'ABCEFGHKMNPRSTUVW1235789'
echo Baser::setCodeset('ABCEFGHKMNPRSTUVW1235789')->getTokenFromInt(646464); // B82MA
echo Baser::setCodeset('ABCEFGHKMNPRSTUVW1235789')->getIntFromToken('B82MA'); // 646464

echo Baser::setCodeset('ABC')->bcMath()->getTokenFromInt(1337);

echo Baser::getTokenFromInt(436432278698); // 7GnTmBA