Encoding Gone Wild


Download the Library

If you have a need to encode an integer into a base(n) (for obfuscation, for example), download the latest release from Github.

Encodes any integer into a base(n) string using a defined alphabet.


The suggested installation method is via composer:

php composer.phar require brianfreytag/php-bijective:dev-master


After installing the Bijective library, simply create a new instance of the Bijective class, passing in a defined alphabet.

use Bijective\BijectiveTranslator;
$alphabet = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$bijective = new BijectiveTranslator($alphabet);
$encoded = $bijective->encode(123); // Returns ct
$decoded = $bijective->decode('ct'); // Returns 123
Web Services Made Easy

Request A Quote

Scroll to Top