类 Randoms
java.lang.Object
com.wf.captcha.base.Randoms
- 直接已知子类:
Captcha
随机数工具类
Created by 王帆 on 2018-07-27 上午 10:08.
-
字段概要
字段修饰符和类型字段说明static final char[]定义验证码字符.去除了0、O、I、L等容易混淆的字母protected static final int字符的最大索引,不包括最大值protected static final int字符的最小索引,包括最小值protected static final int小写字母最大索引protected static final int小写字母最小索引protected static final int数字的最大索引,不包括最大值protected static final SecureRandomprotected static final int大写字符最大索引protected static final int大写字符最小索引 -
构造器概要
构造器 -
方法概要
-
字段详细资料
-
ALPHA
public static final char[] ALPHA定义验证码字符.去除了0、O、I、L等容易混淆的字母 -
RANDOM
-
numMaxIndex
protected static final int numMaxIndex数字的最大索引,不包括最大值- 另请参阅:
-
charMinIndex
protected static final int charMinIndex字符的最小索引,包括最小值- 另请参阅:
-
upperMinIndex
protected static final int upperMinIndex大写字符最小索引- 另请参阅:
-
upperMaxIndex
protected static final int upperMaxIndex大写字符最大索引- 另请参阅:
-
lowerMinIndex
protected static final int lowerMinIndex小写字母最小索引- 另请参阅:
-
charMaxIndex
protected static final int charMaxIndex字符的最大索引,不包括最大值 -
lowerMaxIndex
protected static final int lowerMaxIndex小写字母最大索引
-
-
构造器详细资料
-
Randoms
public Randoms()
-
-
方法详细资料
-
num
public static int num(int min, int max) 产生两个数之间的随机数- 参数:
min- 最小值max- 最大值- 返回:
- 随机数
-
num
public static int num(int num) 产生0-num的随机数,不包括num- 参数:
num- 最大值- 返回:
- 随机数
-
alpha
public static char alpha()返回ALPHA中的随机字符- 返回:
- 随机字符
-
alpha
public static char alpha(int num) 返回ALPHA中第0位到第num位的随机字符- 参数:
num- 到第几位结束- 返回:
- 随机字符
-
alpha
public static char alpha(int min, int max) 返回ALPHA中第min位到第max位的随机字符- 参数:
min- 从第几位开始max- 到第几位结束- 返回:
- 随机字符
-