Download the PHP package ajaxray/short-code without Composer
On this page you can find all versions of the php package ajaxray/short-code. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ajaxray/short-code
More information about ajaxray/short-code
Files in ajaxray/short-code
Package short-code
Short Description ShortCode generator for PHP. Create short, reversible or random, hash like codes.
License MIT
Homepage http://github.com/ajaxray/short-code
Informations about the package short-code
ShortCode
ShortCode generator for PHP. Create short, hash like codes. Codes can be random or reversible. Output format is customizable (see the list below).
You can generate random string code of your desired character length, e.g. 4, 6, 8 ... up to 20.
Also, you can generate reversible codes from numbers. It's useful when you'll need to trace the original number from a reference code string.
Can be used for generating small reference codes, tiny URLs or any other purpose.
Installation
Install the latest version with
Supported Output and Conversion Formats
ShortCode\Code::FORMAT_ALNUM
: (Default) Alphanumaric characters. includes 0-9, a-z and A-ZShortCode\Code::FORMAT_ALNUM_CAPITAL
: Alphanumaric characters. includes 0-9 and A-ZShortCode\Code::FORMAT_ALNUM_SMALL
: Alphanumaric characters. includes 0-9 and a-zShortCode\Code::FORMAT_CHAR_CAPITAL
: Capital letter characters. includes only A-ZShortCode\Code::FORMAT_CHAR_SMALL
: Small letter characters. includes only a-zShortCode\Code::FORMAT_NUMBER
: Numbers. includes only 0-9. Can be used for random number generation
Generating Random Code
Generating Reversible Code from numbers
Reversible code with having a minimum length
You can create code with a minimum output length. You have to mention the length for both, converting and reverting functions.
Please note that, using this method, you can only ensure the minimum character length. This length may exceed for larger numbers.
Dependency
This library has dependency on BCMath PHP extension. Please check the installation page in case you don't have it configured.
Also it can be installed on linux based os with something similar to -
"This is the Book about which there is no doubt, a guidance for those conscious of Allah" - Al-Quran