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字符串