Generate a new token used in describeInstanceResponse while paging enabled.

@return a random string as a token
420184
protected String generateToken() {
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < TOKEN_MIDDLE_LEN; i++) {
            sb.append(TOKEN_DICT.charAt(random.nextInt(TOKEN_DICT.length())));
        }
        return TOKEN_PREFIX + sb.toString() + TOKEN_SUFFIX;
    }
1149636
public static String generateDigitsString(int length) {
        StringBuffer buf = new StringBuffer(length);
        SecureRandom rand = new SecureRandom();
        for (int i = 0; i < length; i++) {
            buf.append(rand.nextInt(digits.length));
        }
        return buf.toString();
    }
935679
public static String randomString(Long numberOfLetters, TestContext context) {
        return new RandomStringFunction().execute(Collections.singletonList(String.valueOf(numberOfLetters)), context);
    }
25575
public String createString() {
        int i;
        int count;

        if (endPageIdx == 0) {
            // speedup the most frequent situation
            return new String(endPage, start, end - start);
        } else {
            char[] buffer;

            buffer = new char[endPageIdx * pageSize + end - start];
            count = pageSize - start;
            System.arraycopy(pages.get(0), start, buffer, 0, count);
            for (i = 1; i < endPageIdx; i++) {
                System.arraycopy(pages.get(i), 0, buffer, count, pageSize);
                count += pageSize;
            }
            System.arraycopy(pages.get(endPageIdx), 0, buffer, count, end);
            return new String(buffer);
        }
    }
1009908
private String generateRandomSession() {
        final int length = 16;
        final SecureRandom r = new SecureRandom();
        final StringBuilder sb = new StringBuilder();
        while (sb.length() < length) {
            sb.append(Integer.toHexString(r.nextInt()));
        }
        return sb.toString().substring(0, length);
    }
323583
public String extractJwtFromTokenEndpointResponse(Page response) throws Exception {
        JsonReader reader = Json.createReader(new StringReader(WebResponseUtils.getResponseText(response)));
        JsonObject jsonResponse = reader.readObject();
        return jsonResponse.getString("token");
    }
88132
public static void createToken(Controller controller, String tokenName, int secondsOfTimeOut) {
		if (tokenCache == null) {
			String tokenId = String.valueOf(random.nextLong());
			controller.setAttr(tokenName, tokenId);
			controller.setSessionAttr(tokenName, tokenId);
			createTokenHiddenField(controller, tokenName, tokenId);
		}
		else {
			createTokenUseTokenIdGenerator(controller, tokenName, secondsOfTimeOut);
		}
	}
201009
public static String generateRandomId() {

        StringBuffer buffer = new StringBuffer();
        int base = 36;
        for (int i = 0; i < 16; i++) {
            buffer.append(Integer.toString(RANDOM.nextInt(base), base));
        }
        return buffer.toString();
    }
692919
public static String generateToken(final HttpServletRequest request, final String key) {
		String token = UUID.randomUUID().toString();
		request.getSession(true).setAttribute(key, token);
		return token;
	}
533651
public String generateNewTag() {
    // This scheme of using random numbers to generate a
    // unique tag has a small probability of
    // causing duplicate tags.
    // TODO at some point, we may want to change it.

    int r = parent.getRandom().nextInt();
    r = (r < 0) ? 0 - r : r; // generate a positive number

    // incorporate registration/session ID (myRegistrationId) into all tags
    // from this
    // client? (for jiplet call identification purposes)

    return Integer.toString(r);
  }
1234082
public final Parser<Token> token() {
    return new Parser<Token>() {
      @Override boolean apply(ParseContext ctxt) {
        int begin = ctxt.getIndex();
        if (!Parser.this.apply(ctxt)) {
          return false;
        }
        int len = ctxt.getIndex() - begin;
        Token token = new Token(begin, len, ctxt.result);
        ctxt.result = token;
        return true;
      }
      @Override public String toString() {
        return Parser.this.toString();
      }
    };
  }
1046960
protected AbstractTokenizer generateTokenizer() {
        Class<? extends AbstractTokenizer> tokenizer = parameters.getTokenizer();
        if(tokenizer==null) {
            return null;
        }

        try {
            return tokenizer.newInstance();
        } 
        catch (InstantiationException | IllegalAccessException ex) {
            throw new RuntimeException(ex);
        }
    }
938872
public Document createDocument(String[] tokenstring) {
		this.lexicon.incrementDocCount();
		return new SimpleDocument(tokenstring, this.lexicon, true);
	}
1250986
protected Token responseToToken(Map<String, String> response) {
		return new Token(response.get(OAUTH_TOKEN), response.get(OAUTH_TOKEN_SECRET));
	}
1081308
public final String generatePasswordResetToken() {
		if (StringUtils.isBlank(identifier)) {
			return "";
		}
		Sysprop s = CoreUtils.getInstance().getDao().read(getAppid(), identifier);
		if (s != null) {
			String token = Utils.generateSecurityToken(42, true);
			s.addProperty(Config._RESET_TOKEN, token);
			CoreUtils.getInstance().getDao().update(getAppid(), s);
			return token;
		}
		return "";
	}
75706
protected function genToken()
    {
        // Generate a new random token (as random as possible)
        $rg = new RandomGenerator();
        $token = $rg->randomToken('md5');

        // Store a file in the session save path (safer than /tmp, as open_basedir might limit that)
        file_put_contents($this->pathForToken($token), $token);

        return $token;
    }
129277
public String generateRandomToken(int length) {
        final char[] token = new char[length];

        for (int i = 0; i < length; i++) {
            final int tokenIndex = random.nextInt(this.tokenChars.length);
            token[i] = tokenChars[tokenIndex];
        }

        return new String(token);
    }