import random def code(n=6,alpha=True): s = '' # 创建字符串变量,存储生成的验证码 for i in range(n): # 通过for循环控制验证码位数 num = random.randint(0,9) # 生成随机数字0-9 if alpha: # 需要字母验证码,不用传参,如果不需要字母的,关键字alpha=False upper_alpha = chr(random.randint(65,90)) lower_alpha = chr(ra
package com.demo.test1; import java.security.NoSuchAlgorithmException; import java.security.SecureRandom; import java.util.regex.Matcher; import java.util.regex.Pattern; public class HighArray { private final static int OFFSET = 538309; public static