Skip to content

Instantly share code, notes, and snippets.

@avevlad
Created February 6, 2014 23:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save avevlad/8854746 to your computer and use it in GitHub Desktop.
Save avevlad/8854746 to your computer and use it in GitHub Desktop.
<?php
require_once('Bijective.php');
/**
* PHP_EOL - новая строка как \n
*/
$b = new Bijective();
echo $b->encode(0). PHP_EOL; // a
echo $b->encode(1). PHP_EOL; // b
echo $b->encode(2). PHP_EOL; // c
echo $b->encode(3). PHP_EOL; // d
echo $b->encode(100). PHP_EOL; // bL
echo $b->encode(9999). PHP_EOL; // cGT
echo $b->encode(9545999). PHP_EOL; // MliY
echo $b->encode(2000000000). PHP_EOL; // ca8FqV
echo '----------------------------------'. PHP_EOL;
echo $b->decode('a'). PHP_EOL; // 0
echo $b->decode('b'). PHP_EOL; // 1
echo $b->decode('c'). PHP_EOL; // 2
echo $b->decode('d'). PHP_EOL; // 3
echo $b->decode('bL'). PHP_EOL; // 100
echo $b->decode('cGT'). PHP_EOL; // 9999
echo $b->decode('MliY'). PHP_EOL; // 9545999
echo $b->decode('ca8FqV'). PHP_EOL; // 2000000000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment