魔众一物一码溯源防伪系统PHP库-随机字符串-RandomUtil

魔众一物一码溯源防伪系统 / 文档中心
文档中心
开发教程
安装常见问题
开发常见问题

number 随机数字

RandomUtil::number( $length )

  • 参数:$length integer 长度
  • 返回:string 字符串

string 随机字符串

RandomUtil::string( $length )

  • 参数:$length integer 长度
  • 返回:string 字符串

readableString 随机可读字符串

去掉0、O等相似字符

RandomUtil::readableString( $length )

  • 参数:$length integer 长度
  • 返回:string 字符串

lowerReadableString 随机可读字符串(小写)

RandomUtil::lowerReadableString( $length )

  • 参数:$length integer 长度
  • 返回:string 字符串

upperReadableString 随机可读字符串(大写)

RandomUtil::upperReadableString( $length )

  • 参数:$length integer 长度
  • 返回:string 字符串

hexString 随机Hex字符串

RandomUtil::hexString( $length )

  • 参数:$length integer 长度
  • 返回:string 字符串

lowerString 随机小写字符串

RandomUtil::lowerString( $length )

  • 参数:$length integer 长度
  • 返回:string 字符串

lowerChar 随机小写字符串

只包含字母

RandomUtil::lowerChar( $length )

  • 参数:$length integer 长度
  • 返回:string 字符串

upperChar 随机大写字符串

只包含字母

RandomUtil::upperChar( $length )

  • 参数:$length integer 长度
  • 返回:string 字符串

upperString 随机大写字符串

RandomUtil::upperString( $length )

  • 参数:$length integer 长度
  • 返回:string 字符串

uuid 随机UUID

使用年月日构造

RandomUtil::uuid( )

  • 返回:string UUID

percent 随机概率

RandomUtil::percent( $value )

  • 参数:$value integer 概率值
  • 返回:boolean 是否成功
QQ
微信
公众号