src/main/java/com/zx/maintain/util/sms/RandomCodeUtil.java

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

package com.zx.maintain.util.sms;

import org.apache.commons.lang.ArrayUtils;


/**
 * @Description: 随机码工具
 * @author jushisi
 * @date 2016-8-22
 */
public class RandomCodeUtil {
	/**
	 * 数字
	 */
	private static char[] numArray = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' };
	
	/**
	 * 小写字母
	 */
	private static char[] lowerCaseArray = { 
		'a', 'b', 'c', 'd', 'e', 'f', 'g',
		'h', 'i', 'j', 'k', 'l', 'm', 'n',
		'o', 'p', 'q', 'r', 's', 't', 
		'u', 'v', 'w', 'x', 'y', 'z' };
	/**
	 * 大写字母
	 */
	private static char[] upperCaseArray = { 
		'A', 'B', 'C', 'D', 'E', 'F', 'G', 
		'H', 'I', 'J', 'K', 'L', 'M', 'N', 
		'O', 'P', 'Q', 'R', 'S', 'T', 
		'U', 'V', 'W', 'X', 'Y', 'Z' };
	/**
	 * 小写字母+大写字母
	 */
	private static char[] alphabet = ArrayUtils.addAll(lowerCaseArray, upperCaseArray);
	/**
	 * 小写字母+大写字母+数字
	 */
	private static char[] allType = ArrayUtils.addAll(alphabet, numArray);

	public enum RandomPolicy {
		/**
		 * 数字
		 */
		NUM(numArray),
		/**
		 * 小写字母
		 */
		LOWER_CASE(lowerCaseArray), 
		/**
		 * 大写字母
		 */
		UPPER_CASE(upperCaseArray), 
		/**
		 * 小写字母+大写字母
		 */
		ALPHABET(alphabet), 
		/**
		 * 小写字母+大写字母+数字
后面还有 38 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。