PHP Class Swoole\RandomKey

显示文件 Open project: matyhtf/swoole_framework

Public Methods

Method Description
getChineseCharacter ( )
idhash ( $uid, $base = 1000 ) : integer 按ID计算散列
randmd5 ( $length = 8, $seed = null ) : string 产生一个随机MD5字符的一部分
randtime ( $rand_length = 6 ) : string 按UNIX时间戳产生随机数
string ( $length = 8, boolean $number = true, array $ignore = ['0', 'o', 'l', '1', 'i'] ) : string 随机生成一个字符串

Method Details

getChineseCharacter() static public method

static public getChineseCharacter ( )

idhash() static public method

按ID计算散列
static public idhash ( $uid, $base = 1000 ) : integer
$uid
$base
return integer

randmd5() static public method

产生一个随机MD5字符的一部分
static public randmd5 ( $length = 8, $seed = null ) : string
$length
$seed
return string

randtime() static public method

按UNIX时间戳产生随机数
static public randtime ( $rand_length = 6 ) : string
$rand_length
return string

string() static public method

随机生成一个字符串
static public string ( $length = 8, boolean $number = true, array $ignore = ['0', 'o', 'l', '1', 'i'] ) : string
$length
$number boolean 只添加数字
$ignore array 忽略某些字符串
return string