code: public static String generate(final int chars) {
          final SecureRandom secureRandom = new SecureRandom();
          final char[] buff = new char[chars];
          for (int i = 0; i < chars; ++i) {
              if (i % 10 == 0) {
                  secureRandom.setSeed(secureRandom.nextLong());
              }
              buff[i] = VALID_CHARACTERS[secureRandom.nextInt(VALID_CHARACTERS.length)];
          }
          return new String(buff);
      }
docs: Generates a cryptographically secure API key of the specified length.
  @param chars the length of the API key to generate
  @return a String representation of the API key