概述
目录
- RandomStringOptions (接口)
- randomBool (常量)
- random (函数)
- randomInt (函数)
- randomRange (函数)
- randomString (函数)
RandomStringOptions (接口)
生成随机文本的选项
签名
interface RandomStringOptions {
/**
*大小写.缺省为null
*/
capitalization?: 'lowercase' | 'uppercase'
/**
*指定字符集.缺省为alphanumeric
*alphanumeric - [0-9 a-z A-Z]
*alphabetic - [a-z A-Z]
*numeric - [0-9]
*hex - [0-9 a-f]
*/
charset?: string
/**
*随机文本的长度.缺省值32
*/
length?: number
/**
*前缀.缺省为null
*/
prefix?: string
/**
*排除不可读的字符0OIl.缺省为false
*/
readable?: boolean
}
v0.2.0 中添加
randomBool (常量)
返回 boolean 的随机数字
签名
export const : I.IO<boolean> = ...
v2.0.0 中添加
random (函数)
返回 0-1 之间的随机数字
签名
export const random: I.IO<number> = () => ...
v2.0.0 中添加
randomInt (函数)
在指定范围内产生随机整数
v2.0.0 中添加
randomRange (函数)
在指定范围内产生随机浮点数
v2.0.0 中添加
randomString (函数)
根据选项产生随机数
签名
export const randomString = (o?:RandomStringOptions): I.IO<string> => () => ...
v0.2.0 中添加