sinergi / token
PHP library to generate random strings
Installs: 8 630
Dependents: 9
Suggesters: 0
Security: 0
Stars: 17
Watchers: 3
Forks: 5
Open Issues: 3
pkg:composer/sinergi/token
Requires
- php: >=5.4.0
Requires (Dev)
- phpunit/phpunit: ~4
This package is not auto-updated.
Last update: 2025-10-25 20:31:34 UTC
README
A handful of tools for PHP developers.
Requirements
This library uses PHP 5.4+.
Installation
It is recommended that you install the Token library through composer. To do so, add the following lines to your composer.json file.
{
"require": {
"sinergi/token": "dev-master"
}
}
Usage
use Sinergi\Token\StringGenerator; StringGenerator::randomAlnum(32);
Methods
-
randomAlnumGenerate alpha-numeric string- Parameters
int $lengthThe length of the string to generate- Optional
bool $onlyUppercaseUse only uppercase letters
-
randomAlphaGenerate alpha string- Parameters
int $lengthThe length of the string to generate- Optional
bool $onlyUppercaseUse only uppercase letters
-
randomNumericGenerate numeric string- Parameters
int $lengthThe length of the string to generate
-
randomHexaGenerate hexa string- Parameters
int $lengthThe length of the string to generate
-
randomUuidGenerate uuid string -
randomIdGenerate id string