<?php
use Utils\NumConverter;
include_once './NumConverter.php';
$converter = new NumConverter(
NumConverter::USE_NUMS_WO_ZERO |
NumConverter::USE_LOWERCASE |
NumConverter::USE_UPPERCASE
);
$converter->addCustom( [
'_', '-', '%', '@', '+', '=', '!', ':', '~', ';', '(', ')', '^', '#', '[', ']', '{', '}'
] );
$number = bcmul( PHP_INT_MAX, 7 ); // 64563604257983430649
$encoded = $converter->encode( $number ); // 7@U1k6k6^-S
$decoded = $converter->decode( $encoded ); // 64563604257983430649
var_dump( $number, $encoded, $decoded ); die;
|