PHP code example of ngubin / key62

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

    

ngubin / key62 example snippets

 php
use Key62\Key62;

$key62 = new Key62();
$key = $key62->encode(100000);
 php
use Key62\Key62;

$characters = 'wWpJbH8nIDed1Evq5OcToF2ZuXsayz7RrtP490ixSKC3GM6gYkNVhBUQmLlfAj';
$length = 4;

$key62 = new Key62($characters, $length);
$key = $key62->encode(100000);
 php
use Key62\Key62;

$key62 = new Key62();
$number = $key62->decode('Gh1a');