/**
     * 生成8位随机数
     * @return
     */
    public String getNonce_str() {
        String SYMBOLS = "0123456789";
        Random RANDOM = new SecureRandom();
        char[] nonceChars = new char[8];
        for (int index = 0; index < nonceChars.length; ++index) {
            nonceChars[index] = SYMBOLS.charAt(RANDOM.nextInt(SYMBOLS.length()));
        }
        return new String(nonceChars);
    }

 

相关文章:

  • 2022-12-23
  • 2021-12-18
  • 2021-12-18
  • 2021-07-13
  • 2021-06-15
  • 2018-07-17
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-18
  • 2021-12-09
  • 2021-12-09
  • 2022-12-23
相关资源
相似解决方案