Skip to content

Repository files navigation

AlphaID - Convert any integer to a short alphanumeric version

ReleasePHP ComposerLicensePHP version

AlphaID

AlphaID let you convert any integer to a short alphanumeric version. It can be useful for generating short, unique, and obfuscated identifiers.

AlphaID Library Versions

These versions should all function harmoniously, allowing for encoding in one language and decoding in another.

Requirements

PHP 7.3 and later.

Installation (Composer)

You can install the bindings via Composer. Run the following command:

composer require devknown/alpha-id

To use the bindings, use Composer's autoload:

require_once('vendor/autoload.php');

Getting Started

Simple usage looks like:

// convert number to a short stringecho \Devknown\AlphaID::convert(258456357951); // Output: '4y7exoH'// recover the original number from the short stringecho \Devknown\AlphaID::recover('4y7exoH'); // Output: 258456357951

Convert with key:

useDevknown\AlphaID;
AlphaID::config('my_key');
echo AlphaID::convert(258456357951);
// the output this time will be '4ymMZq9'echo AlphaID::recover('4ymMZq9');
// the recover output this time will be 258456357951

License

AlphaID is open-source software licensed under the MIT license.

Releases

Packages

Used by

Contributors

Languages