sinergi / token
用于生成随机字符串的PHP库
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: 2024-09-14 15:16:41 UTC
README
为PHP开发者提供的一些工具。
要求
此库使用PHP 5.4及以上版本。
安装
建议您通过composer安装Token库(点击此处)。为此,请将以下行添加到您的composer.json文件中。
{
"require": {
"sinergi/token": "dev-master"
}
}
用法
use Sinergi\Token\StringGenerator; StringGenerator::randomAlnum(32);
方法
-
randomAlnum生成字母数字字符串- 参数
int $length要生成的字符串的长度- 可选
bool $onlyUppercase仅使用大写字母
-
randomAlpha生成字母字符串- 参数
int $length要生成的字符串的长度- 可选
bool $onlyUppercase仅使用大写字母
-
randomNumeric生成数字字符串- 参数
int $length要生成的字符串的长度
-
randomHexa生成十六进制字符串- 参数
int $length要生成的字符串的长度
-
randomUuid生成UUID字符串 -
randomId生成ID字符串