sinergi / token
PHP library to generate random strings
0.1.0
2014-05-24 13:27 UTC
Requires
- php: >=5.4.0
Requires (Dev)
- phpunit/phpunit: ~4
This package is not auto-updated.
Last update: 2026-02-28 22:13:38 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