honest/bijective

Bijective is a class that can compute pairings between alphanumeric strings, and integers. Every integer can be mapped to an alphanumeric string, and every alphanumeric string can be mapped back to an integer with no unpaired permutations.

Installs: 8

Dependents: 0

Stars: 1

Watchers: 1

Forks: 2

Language: PHP

1.0.8 2014-01-09 09:30 UTC

README

Build Status Code Climate

Bijective is a class that can compute pairings between alphanumeric strings, and integers. Every integer can be mapped to an alphanumeric string, and every alphanumeric string can be mapped back to an integer with no unpaired permutations.

Installation

The recommended way to install Bijective is to use Composer.

composer init --require=honest/bijective:1.0.* -n
composer install

Usage example

If you have installed Bijective using Composer, you can start using the class anywhere in your project provided that the Composer autoloader vendor/autoload.php has been registered.

Here is a little usage example:

use Honest\Bijective\Bijective;

$encoded = Bijective::encode(987656789);
echo $encoded, PHP_EOL; // be0gOn
$decoded = Bijective::decode($encoded);
echo $decoded, PHP_EOL; // 987656789