Download the PHP package byjg/shortid without Composer
On this page you can find all versions of the php package byjg/shortid. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package shortid
ShortID
Create short string IDs from numbers
Description
This library enables you to create a very short string from integer numbers.
The basic usage is:
Methods
- fromNumber($number, $map = null): Return a short id from a number
- fromHex($hex, $map = null): Return a short id from a Hex value
- fromUuid($uuid, $map = null): Return a short id from a UUID
- fromRandom($min, $max, $map = null): Return a short id from a random number
- get($shortid, $map = null): Return the Unique Integer Number from the short id (does not work with UUIDs)
Specify your own map
The base of the short id is in the map definition.
Basically, you can create your own sequence here.
The library defines four by default:
- $MAP_DEFAULT
- $MAP_ALTERNATE
- $MAP_NUMBERS_FIRST
- $MAP_RANDOM
The basic usage is:
Installation
Tests
Dependencies
All versions of shortid with dependencies
PHP Build Version
Package Version
Requires
php Version
>=8.1 <8.4
The package byjg/shortid contains the following files
Loading the files please wait ....