monodesigns/randomstring
Composer 安装命令:
composer require monodesigns/randomstring
包简介
Generate random strings/passwords.
README 文档
README
Installation
composer require monodesigns/randomstring
Usage
Randomstring is quite simple.
use monodesigns\Randomstring;
// default usage
Randomstring::generate() // 'qfaP4A'
// custom length (default = 6)
Randomstring::generate(['length' => 4]) // '9suF'
// custom types (default = 'upper lower number')
Randomstring::generate(['types' => 'upper lower']) // 'hWVHkW'
// all types (default = 'upper lower number')
Randomstring::generate(['types' => 'all']) // 'I`}dlN'
// hex
Randomstring::generate(['hex' => true]) // 'e36ad8'
// custom characters
Randomstring::generate(['custom' => '!@']) // '1pZW!Y'
Options
Randomstring::generate([
'length' => 6,
'types' => 'upper lower number',
'hex' => false,
'custom' => ''
]);
// get / set characters for different types
Randomstring::$upper
Randomstring::$lower
Randomstring::$number
Randomstring::$symbol
Randomstring::$hex
If hex is true, it overrides anything set in the types option
统计信息
- 总下载量: 27
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: DBAD
- 更新时间: 2015-12-22