添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
帅气的跑步鞋  ·  ASN.1探索 - 3 ...·  2 周前    · 
谦虚好学的大脸猫  ·  Echarts ...·  昨天    · 
才高八斗的手套  ·  threejs ...·  10 月前    · 
聪明伶俐的白开水  ·  MySQL :: MySQL 8.3 ...·  1 年前    · 
坚韧的弓箭  ·  在Kotlin ...·  2 年前    · 
while (len==32 ){ result = makeRandomPwd(len); if (result.matches(".*[a-z]{1,}.*") && result.matches(".*[A-Z]{1,}.*") && result.matches(".*\\d{1,}.*") && result.matches(".*[~;<@#:>%^]{1,}.*" )) { return result; result = makeRandomPwd(len); return "长度不得少于32位!" ; * @Title: makeRandomPwd * @Description:随机密码生成 * @param len * @return String * @throws public static String makeRandomPwd( int len) { char charr[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890~;<@#:>%^" .toCharArray(); StringBuilder sb = new StringBuilder(); Random r = new Random(); for ( int x = 0; x < len; ++ x) { sb.append(charr[r.nextInt(charr.length)]); return sb.toString(); public static void main(String[] args) { String password = getRandomPwd(32 ); System.out.println( ">>>:"+ password);