https://github.com/devknown/alpha-id
Convert any integer to a short alphanumeric version.
https://github.com/devknown/alpha-id
alphanumeric-strings encoding-decoding javascript number-to-alphanumeric obfuscation php7 php8 python random-id short-string
Last synced: 3 months ago
JSON representation
Convert any integer to a short alphanumeric version.
- Host: GitHub
- URL: https://github.com/devknown/alpha-id
- Owner: devknown
- License: mit
- Created: 2023-06-17T05:30:33.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-10T09:15:57.000Z (about 1 year ago)
- Last Synced: 2025-01-30T04:33:15.143Z (4 months ago)
- Topics: alphanumeric-strings, encoding-decoding, javascript, number-to-alphanumeric, obfuscation, php7, php8, python, random-id, short-string
- Language: PHP
- Homepage:
- Size: 39.1 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
AlphaID - Convert any integer to a short alphanumeric 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.
- [PHP Version](https://github.com/devknown/alpha-id)
- [JavaScript Version](https://github.com/devknown/alpha-id-js)
- [Python Version](https://github.com/devknown/alpha-id-py)## Requirements
PHP 7.3 and later.
## Installation (Composer)
You can install the bindings via [Composer](http://getcomposer.org/). Run the following command:
```bash
composer require devknown/alpha-id
```To use the bindings, use Composer's [autoload](https://getcomposer.org/doc/01-basic-usage.md#autoloading):
```php
require_once('vendor/autoload.php');
```## Getting Started
Simple usage looks like:
```php
// convert number to a short string
echo \Devknown\AlphaID::convert(258456357951); // Output: '4y7exoH'// recover the original number from the short string
echo \Devknown\AlphaID::recover('4y7exoH'); // Output: 258456357951```
Convert with key:
```php
use Devknown\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](https://opensource.org/licenses/MIT).