Guest User

Untitled

a guest
Feb 18th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. static final String AB = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
  2. static SecureRandom rnd = new SecureRandom();
  3.  
  4. public static String randomString( int len ){
  5. StringBuilder sb = new StringBuilder( len );
  6. for( int i = 0; i < len; i++ )
  7. sb.append( AB.charAt( rnd.nextInt(AB.length()) ) );
  8. return sb.toString();
  9. }
Add Comment
Please, Sign In to add comment