Skip to content

brianfreytag/php-bijective

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

Bijective

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

Installation

The suggested installation method is via composer:

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

Usage

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

<?php

use Bijective\BijectiveTranslator;

$alphabet = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';

$bijective = new BijectiveTranslator($alphabet);

$encoded = $bijective->encode(123); // Returns ct
$decoded = $bijective->decode('ct'); // Returns 123

About

Encodes any integer into a base(n) string

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages