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 ) ; }
Generate a random token of the specified length